Mercurial > emacs
diff lisp/dired-aux.el @ 3398:4fb117e74844
(dired-compress-file): Use gzip when proper/possible.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 01 Jun 1993 18:02:02 +0000 |
parents | 02bed2af9f9b |
children | 507f64624555 |
line wrap: on
line diff
--- a/lisp/dired-aux.el Tue Jun 01 17:50:34 1993 +0000 +++ b/lisp/dired-aux.el Tue Jun 01 18:02:02 1993 +0000 @@ -486,14 +486,26 @@ (funcall handler 'dired-compress-file file)) ((file-symlink-p file) nil) - ((string-match "\\.Z$" file) + ((let (case-fold-search) + (string-match "\\.Z$" file)) (if (not (dired-check-process (concat "Uncompressing " file) "uncompress" file)) (substring file 0 -2))) + ((let (case-fold-search) + (string-match "\\.gz$" file)) + (if (not (dired-check-process (concat "Uncompressing " file) + "gunzip" file)) + (substring file 0 -3))) (t - (if (not (dired-check-process (concat "Compressing " file) - "compress" "-f" file)) - (concat file ".Z")))))) + ;;; Try gzip; if we don't have that, use compress. + (condition-case nil + (if (not (dired-check-process (concat "Compressing " file) + "gzip" "-f" file)) + (concat file ".gz")) + (file-error + (if (not (dired-check-process (concat "Compressing " file) + "compress" "-f" file)) + (concat file ".Z")))))))) (defun dired-mark-confirm (op-symbol arg) ;; Request confirmation from the user that the operation described