diff options
| author | Michael Albinus | 2018-02-01 15:00:18 +0100 |
|---|---|---|
| committer | Michael Albinus | 2018-02-01 15:00:18 +0100 |
| commit | 01932c8decb79ab1b7bd5736f41fcfb604ab5141 (patch) | |
| tree | 1b83f569e52396789e8edbb0aad8c8ca75fb761a /lisp | |
| parent | 855ae578ab8999df56e54531815d6a15c67d85aa (diff) | |
| download | emacs-01932c8decb79ab1b7bd5736f41fcfb604ab5141.tar.gz emacs-01932c8decb79ab1b7bd5736f41fcfb604ab5141.zip | |
Revert a1bbc49015 (Bug#30243), do not merge
* lisp/files.el:
* test/lisp/net/tramp-tests.el: Revert a1bbc49015. (Bug#30243)
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/files.el | 111 |
1 files changed, 52 insertions, 59 deletions
diff --git a/lisp/files.el b/lisp/files.el index 882eaa69677..46d4b0c3686 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -6978,67 +6978,60 @@ only these files will be asked to be saved." | |||
| 6978 | ;; We depend on being the last handler on the list, | 6978 | ;; We depend on being the last handler on the list, |
| 6979 | ;; so that anything else which does need handling | 6979 | ;; so that anything else which does need handling |
| 6980 | ;; has been handled already. | 6980 | ;; has been handled already. |
| 6981 | ;; So it is safe for us to inhibit *all* magic file name handlers for | 6981 | ;; So it is safe for us to inhibit *all* magic file name handlers. |
| 6982 | ;; operations, which return a file name. See Bug#29579. | ||
| 6983 | 6982 | ||
| 6984 | (defun file-name-non-special (operation &rest arguments) | 6983 | (defun file-name-non-special (operation &rest arguments) |
| 6985 | (let* ((op-returns-file-name-list | 6984 | (let ((file-name-handler-alist nil) |
| 6986 | '(expand-file-name file-name-directory file-name-as-directory | 6985 | (default-directory |
| 6987 | directory-file-name file-name-sans-versions | 6986 | ;; Some operations respect file name handlers in |
| 6988 | find-backup-file-name file-remote-p)) | 6987 | ;; `default-directory'. Because core function like |
| 6989 | (file-name-handler-alist | 6988 | ;; `call-process' don't care about file name handlers in |
| 6990 | (and | 6989 | ;; `default-directory', we here have to resolve the |
| 6991 | (not (memq operation op-returns-file-name-list)) | 6990 | ;; directory into a local one. For `process-file', |
| 6992 | file-name-handler-alist)) | 6991 | ;; `start-file-process', and `shell-command', this fixes |
| 6993 | (default-directory | 6992 | ;; Bug#25949. |
| 6994 | ;; Some operations respect file name handlers in | 6993 | (if (memq operation '(insert-directory process-file start-file-process |
| 6995 | ;; `default-directory'. Because core function like | 6994 | shell-command)) |
| 6996 | ;; `call-process' don't care about file name handlers in | 6995 | (directory-file-name |
| 6997 | ;; `default-directory', we here have to resolve the | 6996 | (expand-file-name |
| 6998 | ;; directory into a local one. For `process-file', | 6997 | (unhandled-file-name-directory default-directory))) |
| 6999 | ;; `start-file-process', and `shell-command', this fixes | 6998 | default-directory)) |
| 7000 | ;; Bug#25949. | 6999 | ;; Get a list of the indices of the args which are file names. |
| 7001 | (if (memq operation | 7000 | (file-arg-indices |
| 7002 | '(insert-directory process-file start-file-process | 7001 | (cdr (or (assq operation |
| 7003 | shell-command)) | 7002 | ;; The first six are special because they |
| 7004 | (directory-file-name | 7003 | ;; return a file name. We want to include the /: |
| 7005 | (expand-file-name | 7004 | ;; in the return value. |
| 7006 | (unhandled-file-name-directory default-directory))) | 7005 | ;; So just avoid stripping it in the first place. |
| 7007 | default-directory)) | 7006 | '((expand-file-name . nil) |
| 7008 | ;; Get a list of the indices of the args which are file names. | 7007 | (file-name-directory . nil) |
| 7009 | (file-arg-indices | 7008 | (file-name-as-directory . nil) |
| 7010 | (cdr (or (assq operation | 7009 | (directory-file-name . nil) |
| 7011 | ;; The first seven are special because they | 7010 | (file-name-sans-versions . nil) |
| 7012 | ;; return a file name. We want to include the /: | 7011 | (find-backup-file-name . nil) |
| 7013 | ;; in the return value. | 7012 | ;; `identity' means just return the first arg |
| 7014 | ;; So just avoid stripping it in the first place. | 7013 | ;; not stripped of its quoting. |
| 7015 | (append | 7014 | (substitute-in-file-name identity) |
| 7016 | (mapcar 'list op-returns-file-name-list) | 7015 | ;; `add' means add "/:" to the result. |
| 7017 | '(;; `identity' means just return the first arg | 7016 | (file-truename add 0) |
| 7018 | ;; not stripped of its quoting. | 7017 | (insert-file-contents insert-file-contents 0) |
| 7019 | (substitute-in-file-name identity) | 7018 | ;; `unquote-then-quote' means set buffer-file-name |
| 7020 | ;; `add' means add "/:" to the result. | 7019 | ;; temporarily to unquoted filename. |
| 7021 | (file-truename add 0) | 7020 | (verify-visited-file-modtime unquote-then-quote) |
| 7022 | (insert-file-contents insert-file-contents 0) | 7021 | ;; List the arguments which are filenames. |
| 7023 | ;; `unquote-then-quote' means set buffer-file-name | 7022 | (file-name-completion 1) |
| 7024 | ;; temporarily to unquoted filename. | 7023 | (file-name-all-completions 1) |
| 7025 | (verify-visited-file-modtime unquote-then-quote) | 7024 | (write-region 2 5) |
| 7026 | ;; List the arguments which are filenames. | 7025 | (rename-file 0 1) |
| 7027 | (file-name-completion 1) | 7026 | (copy-file 0 1) |
| 7028 | (file-name-all-completions 1) | 7027 | (make-symbolic-link 0 1) |
| 7029 | (write-region 2 5) | 7028 | (add-name-to-file 0 1))) |
| 7030 | (rename-file 0 1) | 7029 | ;; For all other operations, treat the first argument only |
| 7031 | (copy-file 0 1) | 7030 | ;; as the file name. |
| 7032 | (copy-directory 0 1) | 7031 | '(nil 0)))) |
| 7033 | (file-in-directory-p 0 1) | 7032 | method |
| 7034 | (make-symbolic-link 0 1) | 7033 | ;; Copy ARGUMENTS so we can replace elements in it. |
| 7035 | (add-name-to-file 0 1)))) | 7034 | (arguments (copy-sequence arguments))) |
| 7036 | ;; For all other operations, treat the first argument only | ||
| 7037 | ;; as the file name. | ||
| 7038 | '(nil 0)))) | ||
| 7039 | method | ||
| 7040 | ;; Copy ARGUMENTS so we can replace elements in it. | ||
| 7041 | (arguments (copy-sequence arguments))) | ||
| 7042 | (if (symbolp (car file-arg-indices)) | 7035 | (if (symbolp (car file-arg-indices)) |
| 7043 | (setq method (pop file-arg-indices))) | 7036 | (setq method (pop file-arg-indices))) |
| 7044 | ;; Strip off the /: from the file names that have it. | 7037 | ;; Strip off the /: from the file names that have it. |