3822 |
;; Get a list of the indices of the args which are file names. |
;; Get a list of the indices of the args which are file names. |
3823 |
(file-arg-indices |
(file-arg-indices |
3824 |
(cdr (or (assq operation |
(cdr (or (assq operation |
3825 |
;; The first four are special because they |
;; The first five are special because they |
3826 |
;; return a file name. We want to include the /: |
;; return a file name. We want to include the /: |
3827 |
;; in the return value. |
;; in the return value. |
3828 |
;; So just avoid stripping it in the first place. |
;; So just avoid stripping it in the first place. |
3829 |
'((expand-file-name . nil) |
'((expand-file-name . nil) |
|
;; `identity' means just return the first arg |
|
|
;; as stripped of its quoting. |
|
|
(substitute-in-file-name . identity) |
|
3830 |
(file-name-directory . nil) |
(file-name-directory . nil) |
3831 |
(file-name-as-directory . nil) |
(file-name-as-directory . nil) |
3832 |
(directory-file-name . nil) |
(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) |
3837 |
(file-name-completion 0 1) |
(file-name-completion 0 1) |
3838 |
(file-name-all-completions 0 1) |
(file-name-all-completions 0 1) |
3839 |
(rename-file 0 1) |
(rename-file 0 1) |
3858 |
(setq file-arg-indices (cdr file-arg-indices)))) |
(setq file-arg-indices (cdr file-arg-indices)))) |
3859 |
(if (eq file-arg-indices 'identity) |
(if (eq file-arg-indices 'identity) |
3860 |
(car arguments) |
(car arguments) |
3861 |
(apply operation arguments)))) |
(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)))))) |
3867 |
|
|
3868 |
(define-key ctl-x-map "\C-f" 'find-file) |
(define-key ctl-x-map "\C-f" 'find-file) |
3869 |
(define-key ctl-x-map "\C-r" 'find-file-read-only) |
(define-key ctl-x-map "\C-r" 'find-file-read-only) |