Commit 10e1d5f3 authored by Stefan Monnier's avatar Stefan Monnier

* files.el (file-name-non-special): Only change buffer-file-name after

insert-file-contents if it's `visit'ing the file.

Fixes: debbugs:7854
parent 01739ccc
2011-01-24 Stefan Monnier <monnier@iro.umontreal.ca>
* files.el (file-name-non-special): Only change buffer-file-name after
insert-file-contents if it's `visit'ing the file (bug#7854).
2011-01-23 Chong Yidong <cyd@stupidchicken.com>
* dired.el (dired-revert): Doc fix (Bug#7758).
......
......@@ -6041,8 +6041,7 @@ only these files will be asked to be saved."
(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)
(insert-file-contents insert-file-contents 0)
;; `unquote-then-quote' means set buffer-file-name
;; temporarily to unquoted filename.
(verify-visited-file-modtime unquote-then-quote)
......@@ -6073,20 +6072,18 @@ only these files will be asked to be saved."
"/"
(substring (car pair) 2)))))
(setq file-arg-indices (cdr file-arg-indices))))
(cond ((eq method 'identity)
(car arguments))
((eq method 'add)
(concat "/:" (apply operation arguments)))
((eq method 'quote)
(unwind-protect
(case method
(identity (car arguments))
(add (concat "/:" (apply operation arguments)))
(insert-file-contents
(let ((visit (nth 1 arguments)))
(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))
(when (and visit buffer-file-name)
(setq buffer-file-name (concat "/:" buffer-file-name))))))
(unquote-then-quote
(let ((buffer-file-name (substring buffer-file-name 2)))
(apply operation arguments)))
(t
(apply operation arguments)))))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment