summaryrefslogtreecommitdiff
path: root/lisp/dired-aux.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1993-06-01 18:02:02 +0000
committerRichard M. Stallman <rms@gnu.org>1993-06-01 18:02:02 +0000
commitabd352ab4985722cc3d1f19f5bcccf092649702a (patch)
tree3c82e3a9a735b3f644295b9eebacdfa6a4ec7885 /lisp/dired-aux.el
parent543a7885fb8c9aa1f2888c229e5c2b3a4a501a77 (diff)
downloademacs-abd352ab4985722cc3d1f19f5bcccf092649702a.tar.gz
(dired-compress-file): Use gzip when proper/possible.
Diffstat (limited to 'lisp/dired-aux.el')
-rw-r--r--lisp/dired-aux.el20
1 files changed, 16 insertions, 4 deletions
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 3d2f477962c..e452bf26c61 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -486,14 +486,26 @@ and use this command with a prefix argument (the value does not matter)."
(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