From ae3b29834c776376f14b6796ec4118b132e52341 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Thu, 27 May 2004 20:23:31 +0000 Subject: [PATCH] * 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. --- lisp/ChangeLog | 8 ++++++++ lisp/files.el | 25 +++++++++++++++++++++---- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9e5aad11082..5c4101c1ee9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2004-05-27 Michael Albinus + + * 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 * info.el (Info-toc): Call Info-mode on intermediate buffer. diff --git a/lisp/files.el b/lisp/files.el index 06792a0d04e..13145faeddb 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -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))))) -- 2.39.5