diff options
author | Philipp Stephani <phst@google.com> | 2017-03-03 17:56:01 +0100 |
---|---|---|
committer | Philipp Stephani <phst@google.com> | 2017-04-04 14:32:01 +0200 |
commit | 604eb02fff061e663e7523f45a72ecb71c2061e1 (patch) | |
tree | b9328e9f9f6df7e82509de8ed207a8ea03716cf6 /lisp/files.el | |
parent | f4b50dad8d5eade04f495c693c0bca46060b25cb (diff) | |
download | emacs-604eb02fff061e663e7523f45a72ecb71c2061e1.tar.gz |
Make subprocess functions resolve the default directory
`call-process' doesn't respect file name handlers in
`default-directory', so `file-name-non-special' has to resolve them
for `process-file', `start-file-process', and
`shell-command' (Bug#25949).
* lisp/files.el (file-name-non-special): Also resolve default
directory for 'process-file', 'start-file-process', and
'shell-command'.
* test/lisp/files-tests.el
(files-tests--file-name-non-special--subprocess): Add unit test.
Diffstat (limited to 'lisp/files.el')
-rw-r--r-- | lisp/files.el | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/files.el b/lisp/files.el index b4872e46b01..204c26416a6 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -6915,7 +6915,15 @@ only these files will be asked to be saved." (defun file-name-non-special (operation &rest arguments) (let ((file-name-handler-alist nil) (default-directory - (if (eq operation 'insert-directory) + ;; Some operations respect file name handlers in + ;; `default-directory'. Because core function like + ;; `call-process' don't care about file name handlers in + ;; `default-directory', we here have to resolve the + ;; directory into a local one. For `process-file', + ;; `start-file-process', and `shell-command', this fixes + ;; Bug#25949. + (if (memq operation '(insert-directory process-file start-file-process + shell-command)) (directory-file-name (expand-file-name (unhandled-file-name-directory default-directory))) |