From f50577ea07fd85a1798cc2d41251ab1418fd802f Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Fri, 7 May 2021 14:31:17 +0200 Subject: [PATCH] Fix some annoyances wrt file-name-non-special * lisp/files.el (file-name-non-special): Do not expand `file-truename'. * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band): Use local `default-directory' for `start-process'. --- lisp/files.el | 5 ++++- lisp/net/tramp-sh.el | 11 ++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lisp/files.el b/lisp/files.el index 27074beffc1..93a0e07aba0 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -7559,7 +7559,10 @@ only these files will be asked to be saved." (setq file-arg-indices (cdr file-arg-indices)))) (pcase method ('identity (car arguments)) - ('add (file-name-quote (apply operation arguments) t)) + ('add + ;; This is `file-truename'. We don't want file name handlers + ;; to expand this. + (file-name-quote (let (tramp-mode) (apply operation arguments)) t)) ('buffer-file-name (let ((buffer-file-name (file-name-unquote buffer-file-name t))) (apply operation arguments))) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 57be9ecf006..3ce74a2cf1a 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2371,11 +2371,12 @@ The method used must be an out-of-band method." ;; can be handled. We don't set a timeout, because ;; the copying of large files can last longer than 60 ;; secs. - p (apply - #'start-process - (tramp-get-connection-name v) - (tramp-get-connection-buffer v) - copy-program copy-args)) + p (let ((default-directory (tramp-compat-temporary-file-directory))) + (apply + #'start-process + (tramp-get-connection-name v) + (tramp-get-connection-buffer v) + copy-program copy-args))) (tramp-message orig-vec 6 "%s" (string-join (process-command p) " ")) (process-put p 'vector orig-vec) (process-put p 'adjust-window-size-function #'ignore) -- 2.39.2