From 89035e247591c8d688fce922b7079881aa110f33 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Mon, 25 May 2015 10:44:51 +0200 Subject: [PATCH] Inhibit `epa-file-handler' in Tramp Fixes: debbugs:20634 * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-via-buffer) (tramp-sh-handle-insert-file-contents-literally): Inhibit also `epa-file-handler'. --- lisp/net/tramp-cmds.el | 2 +- lisp/net/tramp-sh.el | 10 ++++++---- lisp/net/tramp.el | 7 ++++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index 89baaa444a7..fee74eedec2 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el @@ -158,7 +158,7 @@ This includes password cache, file cache, connection cache, buffers." (if arg (insert tramp-version) (message tramp-version))) ;; Make the "reporter" functionality available for making bug reports about -;; the package. A most useful piece of code. +;; the package. A most useful piece of code. (autoload 'reporter-submit-bug-report "reporter") diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index acb97e880b4..55ac778858c 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2122,15 +2122,16 @@ FILENAME is the source file, NEWNAME the target file. KEEP-DATE is non-nil if NEWNAME should have the same timestamp as FILENAME." ;; We must disable multibyte, because binary data shall not be ;; converted. We don't want the target file to be compressed, so we - ;; let-bind `jka-compr-inhibit' to t. - ;; We remove `tramp-file-name-handler' from + ;; let-bind `jka-compr-inhibit' to t. `epa-file-handler' shall not + ;; be called either. We remove `tramp-file-name-handler' from ;; `inhibit-file-name-handlers'; otherwise the file name handler for ;; `insert-file-contents' might be deactivated in some corner cases. (let ((coding-system-for-read 'binary) (coding-system-for-write 'binary) (jka-compr-inhibit t) (inhibit-file-name-handlers - (remq 'tramp-file-name-handler inhibit-file-name-handlers))) + (cons epa-file-handler + . (remq 'tramp-file-name-handler inhibit-file-name-handlers)))) (with-temp-file newname (set-buffer-multibyte nil) (insert-file-contents-literally filename))) @@ -3205,7 +3206,8 @@ the result will be a local, non-Tramp, file name." (if (fboundp 'find-buffer-file-type) (symbol-function 'find-buffer-file-type) nil)) - (inhibit-file-name-handlers '(jka-compr-handler image-file-handler)) + (inhibit-file-name-handlers + '(epa-file-handler image-file-handler jka-compr-handler)) (inhibit-file-name-operation 'insert-file-contents)) (unwind-protect (progn diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 95f54490cac..22adbd9b474 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3103,9 +3103,10 @@ User is always nil." (setq tramp-temp-buffer-file-name nil beg nil end nil)) ;; `insert-file-contents-literally' takes care to - ;; avoid calling jka-compr. By let-binding - ;; `inhibit-file-name-operation', we propagate that - ;; care to the `file-local-copy' operation. + ;; avoid calling jka-compr.el and epa.el. By + ;; let-binding `inhibit-file-name-operation', we + ;; propagate that care to the `file-local-copy' + ;; operation. (setq local-copy (let ((inhibit-file-name-operation (when (eq inhibit-file-name-operation -- 2.39.2