]> git.eshelyaron.com Git - emacs.git/commitdiff
* files.el (file-name-non-special): There are more operations
authorMichael Albinus <michael.albinus@gmx.de>
Thu, 27 May 2004 20:23:31 +0000 (20:23 +0000)
committerMichael Albinus <michael.albinus@gmx.de>
Thu, 27 May 2004 20:23:31 +0000 (20:23 +0000)
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.

lisp/ChangeLog
lisp/files.el

index 9e5aad11082809784a85ef39c8a543c3f7455240..5c4101c1ee9aeef9068a5179f5d2a2d3caa1260b 100644 (file)
@@ -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.
index 06792a0d04e5f6f315a04d2a9cf698d151f333ed..13145faeddb926b066fc7916485edace4976869d 100644 (file)
@@ -4481,7 +4481,7 @@ With prefix arg, silently save all file-visiting buffers, then kill."
        ;; 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 @@ With prefix arg, silently save all file-visiting buffers, then kill."
                          (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 @@ With prefix arg, silently save all file-visiting buffers, then kill."
        (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)))))
 \f