]> code.delx.au - gnu-emacs/blobdiff - lisp/dired-aux.el
(MIPS2): Comment out define.
[gnu-emacs] / lisp / dired-aux.el
index 3cff0fc3ea7655608e0b067ffc5a1e17cedc2451..e452bf26c61606826268af1f774f46c8dc96b7fc 100644 (file)
@@ -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)
-          (if (dired-check-process (concat "Uncompressing " file)
-                                   "uncompress" 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 (dired-check-process (concat "Compressing " file)
-                                   "compress" "-f" file)
-              (concat name ".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"))))))))
 \f
 (defun dired-mark-confirm (op-symbol arg)
   ;; Request confirmation from the user that the operation described