changeset 55726:9dbff3d047a0

(file-name-non-special): Allow t in file-arg-indices to mean requote the return value. Use `identity' as an element rather than as the whole value.
author Richard M. Stallman <rms@gnu.org>
date Sat, 22 May 2004 07:40:41 +0000
parents 00841464e6d8
children babf5161afd4
files lisp/files.el
diffstat 1 files changed, 14 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Sat May 22 07:38:06 2004 +0000
+++ b/lisp/files.el	Sat May 22 07:40:41 2004 +0000
@@ -4487,10 +4487,12 @@
 			  (directory-file-name . nil)
 			  (file-name-sans-versions . nil)
 			  ;; `identity' means just return the first arg
-			  ;; as stripped of its quoting.
-			  (substitute-in-file-name . identity)
+			  ;; not stripped of its quoting.
+			  (substitute-in-file-name identity)
 			  (file-name-completion 1)
 			  (file-name-all-completions 1)
+			  ;; t means add "/:" to the result.
+			  (file-truename t 0)
 			  (rename-file 0 1)
 			  (copy-file 0 1)
 			  (make-symbolic-link 0 1)
@@ -4498,9 +4500,12 @@
 		  ;; For all other operations, treat the first argument only
 		  ;; as the file name.
 		  '(nil 0))))
+	method
 	;; Copy ARGUMENTS so we can replace elements in it.
 	(arguments (copy-sequence arguments)))
-    ;; Strip off the /: from the file names that have this handler.
+    (if (symbolp (car file-arg-indices))
+	(setq method (pop file-arg-indices)))
+    ;; Strip off the /: from the file names that have it.
     (save-match-data
       (while (consp file-arg-indices)
 	(let ((pair (nthcdr (car file-arg-indices) arguments)))
@@ -4511,9 +4516,12 @@
 			   "/"
 			 (substring (car pair) 2)))))
 	(setq file-arg-indices (cdr file-arg-indices))))
-    (if (eq file-arg-indices 'identity)
-	(car arguments)
-      (apply operation arguments))))
+    (cond ((eq method 'identity)
+	   (car arguments))
+	  (method
+	   (concat "/:" (apply operation arguments)))
+	  (t
+	   (apply operation arguments)))))
 
 (define-key ctl-x-map "\C-f" 'find-file)
 (define-key ctl-x-map "\C-r" 'find-file-read-only)