+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.
;; 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.
(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)
(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