diff options
| -rw-r--r-- | lisp/files.el | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lisp/files.el b/lisp/files.el index e22443b19a1..e748b6069ce 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -3822,17 +3822,18 @@ With prefix arg, silently save all file-visiting buffers, then kill." | |||
| 3822 | ;; Get a list of the indices of the args which are file names. | 3822 | ;; Get a list of the indices of the args which are file names. |
| 3823 | (file-arg-indices | 3823 | (file-arg-indices |
| 3824 | (cdr (or (assq operation | 3824 | (cdr (or (assq operation |
| 3825 | ;; The first four are special because they | 3825 | ;; The first five are special because they |
| 3826 | ;; return a file name. We want to include the /: | 3826 | ;; return a file name. We want to include the /: |
| 3827 | ;; in the return value. | 3827 | ;; in the return value. |
| 3828 | ;; So just avoid stripping it in the first place. | 3828 | ;; So just avoid stripping it in the first place. |
| 3829 | '((expand-file-name . nil) | 3829 | '((expand-file-name . nil) |
| 3830 | ;; `identity' means just return the first arg | ||
| 3831 | ;; as stripped of its quoting. | ||
| 3832 | (substitute-in-file-name . identity) | ||
| 3833 | (file-name-directory . nil) | 3830 | (file-name-directory . nil) |
| 3834 | (file-name-as-directory . nil) | 3831 | (file-name-as-directory . nil) |
| 3835 | (directory-file-name . nil) | 3832 | (directory-file-name . nil) |
| 3833 | (file-name-sans-versions . nil) | ||
| 3834 | ;; `identity' means just return the first arg | ||
| 3835 | ;; as stripped of its quoting. | ||
| 3836 | (substitute-in-file-name . identity) | ||
| 3836 | (file-name-completion 0 1) | 3837 | (file-name-completion 0 1) |
| 3837 | (file-name-all-completions 0 1) | 3838 | (file-name-all-completions 0 1) |
| 3838 | (rename-file 0 1) | 3839 | (rename-file 0 1) |
| @@ -3857,7 +3858,12 @@ With prefix arg, silently save all file-visiting buffers, then kill." | |||
| 3857 | (setq file-arg-indices (cdr file-arg-indices)))) | 3858 | (setq file-arg-indices (cdr file-arg-indices)))) |
| 3858 | (if (eq file-arg-indices 'identity) | 3859 | (if (eq file-arg-indices 'identity) |
| 3859 | (car arguments) | 3860 | (car arguments) |
| 3860 | (apply operation arguments)))) | 3861 | (let ((value (apply operation arguments))) |
| 3862 | (cond ((memq operation '(file-name-completion)) | ||
| 3863 | (and value (concat "/:" value))) | ||
| 3864 | ((memq operation '(file-name-all-completions)) | ||
| 3865 | (mapcar (lambda (name) (concat "/:" name)) value)) | ||
| 3866 | (t value)))))) | ||
| 3861 | 3867 | ||
| 3862 | (define-key ctl-x-map "\C-f" 'find-file) | 3868 | (define-key ctl-x-map "\C-f" 'find-file) |
| 3863 | (define-key ctl-x-map "\C-r" 'find-file-read-only) | 3869 | (define-key ctl-x-map "\C-r" 'find-file-read-only) |