changeset 55778:f4d8fa42ea58

* files.el (file-name-non-special): There are more operations which need handling: `find-backup-file-name', `insert-file-contents', `verify-visited-file-modtime', `write-region'. Rename t value of method to `add'. Add new methods `quote' and `unquote-then-quote' to file-arg-indices.
author Michael Albinus <michael.albinus@gmx.de>
date Thu, 27 May 2004 20:23:31 +0000
parents de35aa92d3f3
children 5a212b0ada97
files lisp/ChangeLog lisp/files.el
diffstat 2 files changed, 29 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed May 26 22:11:29 2004 +0000
+++ b/lisp/ChangeLog	Thu May 27 20:23:31 2004 +0000
@@ -1,3 +1,11 @@
+2004-05-27  Michael Albinus  <michael.albinus@gmx.de>
+
+	* files.el (file-name-non-special): There are more operations
+	which need handling: `find-backup-file-name',
+	`insert-file-contents', `verify-visited-file-modtime',
+	`write-region'.  Rename t value of method to `add'.  Add new
+	methods `quote' and `unquote-then-quote' to file-arg-indices.
+
 2004-05-25  Juri Linkov  <juri@jurta.org>
 
 	* info.el (Info-toc): Call Info-mode on intermediate buffer.
--- a/lisp/files.el	Wed May 26 22:11:29 2004 +0000
+++ b/lisp/files.el	Thu May 27 20:23:31 2004 +0000
@@ -4481,7 +4481,7 @@
 	;; Get a list of the indices of the args which are file names.
 	(file-arg-indices
 	 (cdr (or (assq operation
-			;; The first five are special because they
+			;; The first six are special because they
 			;; return a file name.  We want to include the /:
 			;; in the return value.
 			;; So just avoid stripping it in the first place.
@@ -4490,13 +4490,21 @@
 			  (file-name-as-directory . nil)
 			  (directory-file-name . nil)
 			  (file-name-sans-versions . nil)
+			  (find-backup-file-name . nil)
 			  ;; `identity' means just return the first arg
 			  ;; not stripped of its quoting.
 			  (substitute-in-file-name identity)
+			  ;; `add' means add "/:" to the result.
+			  (file-truename add 0)
+			  ;; `quote' means add "/:" to buffer-file-name.
+			  (insert-file-contents quote 0)
+			  ;; `unquote-then-quote' means set buffer-file-name
+			  ;; temporarily to unquoted filename.
+			  (verify-visited-file-modtime unquote-then-quote)
+			  ;; List the arguments which are filenames.
 			  (file-name-completion 1)
 			  (file-name-all-completions 1)
-			  ;; t means add "/:" to the result.
-			  (file-truename t 0)
+			  (write-region 2 5)
 			  (rename-file 0 1)
 			  (copy-file 0 1)
 			  (make-symbolic-link 0 1)
@@ -4522,8 +4530,17 @@
 	(setq file-arg-indices (cdr file-arg-indices))))
     (cond ((eq method 'identity)
 	   (car arguments))
-	  (method
+	  ((eq method 'add)
 	   (concat "/:" (apply operation arguments)))
+	  ((eq method 'quote)
+	   (prog1 (apply operation arguments)
+	     (setq buffer-file-name (concat "/:" buffer-file-name))))
+	  ((eq method 'unquote-then-quote)
+	   (let (res)
+	     (setq buffer-file-name (substring buffer-file-name 2))
+	     (setq res (apply operation arguments))
+	     (setq buffer-file-name (concat "/:" buffer-file-name))
+	     res))
 	  (t
 	   (apply operation arguments)))))