X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/8bdf601fe8bbb5701cd320fd0085aa5b8a6ba5ec..507c5deb1e04694ed6c7393c54ebbacafc1062cd:/lisp/jka-compr.el diff --git a/lisp/jka-compr.el b/lisp/jka-compr.el index e1780b3329..7a0f39d89e 100644 --- a/lisp/jka-compr.el +++ b/lisp/jka-compr.el @@ -77,9 +77,9 @@ ;; ACKNOWLEDGMENTS -;; +;; ;; jka-compr is a V19 adaptation of jka-compr for V18 of Emacs. Many people -;; have made helpful suggestions, reported bugs, and even fixed bugs in +;; have made helpful suggestions, reported bugs, and even fixed bugs in ;; jka-compr. I recall the following people as being particularly helpful. ;; ;; Jean-loup Gailly @@ -117,7 +117,7 @@ for `jka-compr-compression-info-list')." :type 'string :group 'jka-compr) -(defvar jka-compr-use-shell +(defvar jka-compr-use-shell (not (memq system-type '(ms-dos windows-nt)))) ;;; I have this defined so that .Z files are assumed to be in unix @@ -270,8 +270,8 @@ based on the filename itself and `jka-compr-compression-info-list'." (signal 'compression-error (list "Opening input file" (format "error %s" message) infile))) - - + + (defcustom jka-compr-dd-program "/bin/dd" "How to invoke `dd'." :type 'string @@ -356,7 +356,7 @@ to keep: LEN chars starting BEG chars from the beginning." (jka-compr-delete-temp-file err-file))) - (or (zerop + (or (eq 0 (apply 'call-process prog infile @@ -447,7 +447,7 @@ There should be no more than seven characters after the final `/'." (setq temp-file (jka-compr-make-temp-name))) - (and + (and compress-message (message "%s %s..." compress-message base-name)) @@ -502,7 +502,7 @@ There should be no more than seven characters after the final `/'." (setq last-coding-system-used coding-system-used) nil) - + (jka-compr-run-real-handler 'write-region (list start end filename append visit))))) @@ -538,7 +538,7 @@ There should be no more than seven characters after the final `/'." (unwind-protect ; to make sure local-copy gets deleted (progn - + (and uncompress-message (message "%s %s..." uncompress-message base-name)) @@ -573,17 +573,14 @@ There should be no more than seven characters after the final `/'." uncompress-args))) (setq size (- (point) start)) (if replace - (let* ((del-beg (point)) - (del-end (+ del-beg size))) - (delete-region del-beg - (min del-end (point-max))))) + (delete-region (point) (point-max))) (goto-char start)) (error (if (and (eq (car error-code) 'file-error) (eq (nth 3 error-code) local-file)) (if visit (setq notfound error-code) - (signal 'file-error + (signal 'file-error (cons "Opening input file" (nthcdr 2 error-code)))) (signal (car error-code) (cdr error-code)))))) @@ -593,10 +590,11 @@ There should be no more than seven characters after the final `/'." (file-exists-p local-copy) (delete-file local-copy))) - (decode-coding-inserted-region - (point) (+ (point) size) - (jka-compr-byte-compiler-base-file-name file) - visit beg end replace) + (unless notfound + (decode-coding-inserted-region + (point) (+ (point) size) + (jka-compr-byte-compiler-base-file-name file) + visit beg end replace)) (and visit @@ -605,7 +603,7 @@ There should be no more than seven characters after the final `/'." (setq buffer-file-name filename) (setq jka-compr-really-do-compress t) (set-visited-file-modtime))) - + (and uncompress-message (message "%s %s...done" uncompress-message base-name)) @@ -661,11 +659,11 @@ There should be no more than seven characters after the final `/'." (unwind-protect (with-current-buffer temp-buffer - + (and uncompress-message (message "%s %s..." uncompress-message base-name)) - + ;; Here we must read the output of uncompress program ;; and write it to TEMP-FILE without any code ;; conversion. An appropriate code conversion (if @@ -697,7 +695,7 @@ There should be no more than seven characters after the final `/'." (kill-buffer temp-buffer)) temp-file) - + (jka-compr-run-real-handler 'file-local-copy (list filename))))) @@ -865,7 +863,7 @@ by `jka-compr-installed'." (eq (nth 2 entry) 'jka-compr))) (setcdr last (cdr (cdr last))) (setq last (cdr last)))) - + (setq auto-mode-alist (cdr ama))) (let* ((ama (cons nil file-coding-system-alist)) @@ -877,7 +875,7 @@ by `jka-compr-installed'." (if (member entry jka-compr-added-to-file-coding-system-alist) (setcdr last (cdr (cdr last))) (setq last (cdr last)))) - + (setq file-coding-system-alist (cdr ama))) ;; Remove the suffixes that were added by jka-compr. @@ -888,7 +886,7 @@ by `jka-compr-installed'." (push suffix suffixes))) (setq load-suffixes (nreverse suffixes)))) - + (defun jka-compr-installed-p () "Return non-nil if jka-compr is installed. The return value is the entry in `file-name-handler-alist' for jka-compr." @@ -943,4 +941,5 @@ Returns the new status of auto compression (non-nil means on)." (provide 'jka-compr) +;;; arch-tag: 3f15b630-e9a7-46c4-a22a-94afdde86ebc ;;; jka-compr.el ends here