diff options
author | Juri Linkov <juri@linkov.net> | 2019-02-17 23:07:43 +0200 |
---|---|---|
committer | Juri Linkov <juri@linkov.net> | 2019-02-17 23:07:43 +0200 |
commit | 4f24b4a6dff0c257d1c1ea49338efcdff59446b0 (patch) | |
tree | 50c073cfd31126ddd1f3b779347cfc8d7b61056f /lisp | |
parent | adeea448bcbf12b8f6f33af0ddc9867fa49f5b4a (diff) | |
download | emacs-4f24b4a6dff0c257d1c1ea49338efcdff59446b0.tar.gz |
* lisp/tar-mode.el (tar--try-jka-compr): Remove. (Bug#34251)
(tar-extract): Call archive-try-jka-compr instead of tar--try-jka-compr.
* lisp/arc-mode.el (archive-try-jka-compr): Call set-buffer-multibyte
after erase-buffer.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/arc-mode.el | 2 | ||||
-rw-r--r-- | lisp/tar-mode.el | 23 |
2 files changed, 3 insertions, 22 deletions
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index 2b5b6166ad5..8de01030195 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el @@ -967,8 +967,8 @@ using `make-temp-file', and the generated name is returned." ;; Don't re-compress this data just before decompressing it. (jka-compr-inhibit t)) (write-region (point-min) (point-max) tmpfile nil 'quiet)) - (set-buffer-multibyte t) (erase-buffer) + (set-buffer-multibyte t) (insert-file-contents tmpfile)) (delete-file tmpfile))))) diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el index c5382d3f3d1..599da9ac807 100644 --- a/lisp/tar-mode.el +++ b/lisp/tar-mode.el @@ -95,6 +95,7 @@ ;;; Code: (eval-when-compile (require 'cl-lib)) +(require 'arc-mode) (defgroup tar nil "Simple editing of tar files." @@ -852,26 +853,6 @@ actually appear on disk when you save the tar-file's buffer." (goto-char (posn-point (event-end event))) (tar-extract)) -(defun tar--try-jka-compr () - (when (and auto-compression-mode - (jka-compr-get-compression-info buffer-file-name)) - (let* ((basename (file-name-nondirectory buffer-file-name)) - (tmpname (if (string-match ":\\([^:]+\\)\\'" basename) - (match-string 1 basename) basename)) - (tmpfile (make-temp-file (file-name-sans-extension tmpname) - nil - (file-name-extension tmpname 'period)))) - (unwind-protect - (progn - (let ((coding-system-for-write 'no-conversion) - ;; Don't re-compress this data just before decompressing it. - (jka-compr-inhibit t)) - (write-region (point-min) (point-max) tmpfile nil 'quiet)) - (set-buffer-multibyte t) - (erase-buffer) - (insert-file-contents tmpfile)) - (delete-file tmpfile))))) - (defun tar-file-name-handler (op &rest args) "Helper function for `tar-extract'." (or (eq op 'file-exists-p) @@ -951,7 +932,7 @@ actually appear on disk when you save the tar-file's buffer." (setq buffer-file-name new-buffer-file-name) (setq buffer-file-truename (abbreviate-file-name buffer-file-name)) - (tar--try-jka-compr) ;Pretty ugly hack :-( + (archive-try-jka-compr) ;Pretty ugly hack :-( ;; Force buffer-file-coding-system to what ;; decode-coding-region actually used. (set-buffer-file-coding-system last-coding-system-used t) |