Here is a simple patch to uncompress.el that allows it to support .tgz
(tar gzip) files. I use it mainly from dired to uncompress and open
the tar file.
I don't know if it is kosher to change FSF files that are synced and I
have no access to emacs source, so I have posted this to xemacs-beta
in the hopes it will be useful to someone.
Sean
1999-08-13 Sean MacLennan <seanm(a)storm.ca>
* uncompress.el (uncompress-while-visiting): added support for
.tgz (tar gzip) files.
--- xemacs/packages/lisp/os-utils/uncompress.el.orig Fri Aug 13 22:57:26 1999
+++ xemacs/packages/lisp/os-utils/uncompress.el Mon Aug 9 23:11:16 1999
@@ -50,21 +50,25 @@
(or (assoc "\\.Z$" auto-mode-alist)
(setq auto-mode-alist
(cons '("\\.Z$" . uncompress-while-visiting) auto-mode-alist)))
-(or (assoc "\\.gz$" auto-mode-alist)
+(or (assoc "\\.t?gz$" auto-mode-alist)
(setq auto-mode-alist
- (cons '("\\.gz$" . uncompress-while-visiting) auto-mode-alist)))
+ (cons '("\\.t?gz$" . uncompress-while-visiting) auto-mode-alist)))
(defun uncompress-while-visiting ()
"Temporary \"major mode\" used for .Z and .gz files, to uncompress
them.
It then selects a major mode from the uncompressed file name and contents."
- (if (and (not (null buffer-file-name))
- (string-match "\\.Z$" buffer-file-name))
- (set-visited-file-name
- (substring buffer-file-name 0 (match-beginning 0)))
- (if (and (not (null buffer-file-name))
- (string-match "\\.gz$" buffer-file-name))
- (set-visited-file-name
- (substring buffer-file-name 0 (match-beginning 0)))))
+ (if (not (null buffer-file-name))
+ (if (string-match "\\.Z$" buffer-file-name)
+ (set-visited-file-name
+ (substring buffer-file-name 0 (match-beginning 0)))
+ (if (string-match "\\.gz$" buffer-file-name)
+ (set-visited-file-name
+ (substring buffer-file-name 0 (match-beginning 0)))
+ (if (string-match "\\.tgz$" buffer-file-name)
+ (set-visited-file-name
+ (concat
+ (substring buffer-file-name 0 (match-beginning 0))
+ ".tar"))))))
(message "Uncompressing...")
(let ((buffer-read-only nil))
(shell-command-on-region (point-min) (point-max) uncompress-program t))
--
Sean MacLennan A bad day running Linux,
Ottawa, Canada Is better than a good day running windoze.
http://www.storm.ca/~seanm