Commit a522e5bf authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(set-visited-file-name): Handle find-file-visit-truename

early on, before we deal with lock files.
parent ed160f1f
......@@ -1172,11 +1172,19 @@ nil or empty string as argument means make buffer not be visiting any file.
Remember to delete the initial contents of the minibuffer
if you wish to pass an empty string as the argument."
(interactive "FSet visited file name: ")
(let (truename)
(if filename
(setq filename
(if (string-equal filename "")
(expand-file-name filename))))
(if filename
(setq truename (file-truename filename))
(if find-file-visit-truename
;; Do not use the abbreviated filename, because
;; write-region will reset it to the expanded filename
(setq filename truename))))
(or (equal filename buffer-file-name)
(and filename (lock-buffer filename))
......@@ -1193,14 +1201,11 @@ if you wish to pass an empty string as the argument."
(rename-buffer new-name t))))
(setq buffer-backed-up nil)
(setq buffer-file-truename (abbreviate-file-name truename))
(setq buffer-file-number
(if filename
(setq buffer-file-truename
(abbreviate-file-name (file-truename buffer-file-name)))
(if find-file-visit-truename
(setq buffer-file-name buffer-file-truename))
(setq buffer-file-number (nth 10 (file-attributes buffer-file-name))))
(setq buffer-file-truename nil buffer-file-number nil))
(nth 10 (file-attributes buffer-file-name))
;; write-file-hooks is normally used for things like ftp-find-file
;; that visit things that are not local files as if they were files.
;; Changing to visit an ordinary local file instead should flush the hook.
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