aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2014-11-04 10:02:56 +0100
committerMichael Albinus2014-11-04 10:02:56 +0100
commitb6ad705482c2b6e42e9d38f427765fc56319567e (patch)
treebbb90dca4a29c94eb8abd884d856ac65adb6da63
parent46fc78f57e9be79e144303066b9164b000af76fa (diff)
downloademacs-b6ad705482c2b6e42e9d38f427765fc56319567e.tar.gz
emacs-b6ad705482c2b6e42e9d38f427765fc56319567e.zip
* net/tramp-sh.el (tramp-do-copy-or-rename-file-via-buffer): Don't use
a local copy; setting `inhibit-file-name-handlers' proper might be more performant. Fixes: debbugs:18751
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/net/tramp-sh.el13
2 files changed, 13 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d0d61da52f4..12a140d445d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12014-11-04 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/tramp-sh.el (tramp-do-copy-or-rename-file-via-buffer): Don't use
4 a local copy; setting `inhibit-file-name-handlers' proper might be
5 more performant. (Bug#18751)
6
12014-11-04 Glenn Morris <rgm@gnu.org> 72014-11-04 Glenn Morris <rgm@gnu.org>
2 8
3 * mail/emacsbug.el (report-emacs-bug): No longer include 9 * mail/emacsbug.el (report-emacs-bug): No longer include
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index a72a79a7797..3103eb0daa2 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -2061,15 +2061,16 @@ FILENAME is the source file, NEWNAME the target file.
2061KEEP-DATE is non-nil if NEWNAME should have the same timestamp as FILENAME." 2061KEEP-DATE is non-nil if NEWNAME should have the same timestamp as FILENAME."
2062 (with-temp-buffer 2062 (with-temp-buffer
2063 ;; We must disable multibyte, because binary data shall not be 2063 ;; We must disable multibyte, because binary data shall not be
2064 ;; converted. `insert-file-contents-literally' does not support 2064 ;; converted. We remove `tramp-file-name-handler' from
2065 ;; file name handlers for GNU Emacs; we must create a local copy 2065 ;; `inhibit-file-name-handlers'; otherwise the file name handler
2066 ;; therefore. 2066 ;; for `insert-file-contents' might be deactivated in some corner
2067 ;; cases.
2067 (set-buffer-multibyte nil) 2068 (set-buffer-multibyte nil)
2068 (let ((coding-system-for-read 'binary) 2069 (let ((coding-system-for-read 'binary)
2069 (jka-compr-inhibit t) 2070 (jka-compr-inhibit t)
2070 (tmpfile (file-local-copy filename))) 2071 (inhibit-file-name-handlers
2071 (insert-file-contents-literally (or tmpfile filename)) 2072 (remq 'tramp-file-name-handler inhibit-file-name-handlers)))
2072 (when tmpfile (delete-file tmpfile))) 2073 (insert-file-contents-literally filename))
2073 ;; We don't want the target file to be compressed, so we let-bind 2074 ;; We don't want the target file to be compressed, so we let-bind
2074 ;; `jka-compr-inhibit' to t. 2075 ;; `jka-compr-inhibit' to t.
2075 (let ((coding-system-for-write 'binary) 2076 (let ((coding-system-for-write 'binary)