comparison 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
comparison
equal deleted inserted replaced
3397:b21d11dec171 3398:4fb117e74844
484 (let ((handler (find-file-name-handler file))) 484 (let ((handler (find-file-name-handler file)))
485 (cond (handler 485 (cond (handler
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
500 ;; by OP-SYMBOL is to be performed on the marked files. 512 ;; by OP-SYMBOL is to be performed on the marked files.
501 ;; Confirmation consists in a y-or-n question with a file list 513 ;; Confirmation consists in a y-or-n question with a file list