diff options
| author | Richard M. Stallman | 1993-06-01 18:02:02 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-06-01 18:02:02 +0000 |
| commit | e251a1fdf485bc9056493ada04f66139dfc1994a (patch) | |
| tree | 5ba6645cc258f6816bf70aa0bc9c8fca3c7bce26 | |
| parent | 3a48ae79787f55d8e8bcf867ab2cf54e5a27c521 (diff) | |
| download | emacs-e251a1fdf485bc9056493ada04f66139dfc1994a.tar.gz emacs-e251a1fdf485bc9056493ada04f66139dfc1994a.zip | |
(dired-compress-file): Use gzip when proper/possible.
| -rw-r--r-- | lisp/dired-aux.el | 20 |
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)." | |||
| 486 | (funcall handler 'dired-compress-file file)) | 486 | (funcall handler 'dired-compress-file file)) |
| 487 | ((file-symlink-p file) | 487 | ((file-symlink-p file) |
| 488 | nil) | 488 | nil) |
| 489 | ((string-match "\\.Z$" file) | 489 | ((let (case-fold-search) |
| 490 | (string-match "\\.Z$" file)) | ||
| 490 | (if (not (dired-check-process (concat "Uncompressing " file) | 491 | (if (not (dired-check-process (concat "Uncompressing " file) |
| 491 | "uncompress" file)) | 492 | "uncompress" file)) |
| 492 | (substring file 0 -2))) | 493 | (substring file 0 -2))) |
| 494 | ((let (case-fold-search) | ||
| 495 | (string-match "\\.gz$" file)) | ||
| 496 | (if (not (dired-check-process (concat "Uncompressing " file) | ||
| 497 | "gunzip" file)) | ||
| 498 | (substring file 0 -3))) | ||
| 493 | (t | 499 | (t |
| 494 | (if (not (dired-check-process (concat "Compressing " file) | 500 | ;;; Try gzip; if we don't have that, use compress. |
| 495 | "compress" "-f" file)) | 501 | (condition-case nil |
| 496 | (concat file ".Z")))))) | 502 | (if (not (dired-check-process (concat "Compressing " file) |
| 503 | "gzip" "-f" file)) | ||
| 504 | (concat file ".gz")) | ||
| 505 | (file-error | ||
| 506 | (if (not (dired-check-process (concat "Compressing " file) | ||
| 507 | "compress" "-f" file)) | ||
| 508 | (concat file ".Z")))))))) | ||
| 497 | 509 | ||
| 498 | (defun dired-mark-confirm (op-symbol arg) | 510 | (defun dired-mark-confirm (op-symbol arg) |
| 499 | ;; Request confirmation from the user that the operation described | 511 | ;; Request confirmation from the user that the operation described |