diff lisp/files.el @ 24653:0d75a033fceb

(find-file-noselect-1): If buffer-file-name has changed after find-file-not-found-hooks runs, recompute the truename. And don't use FILENAME after that point.
author Karl Heuer <kwzh@gnu.org>
date Thu, 29 Apr 1999 20:28:43 +0000
parents 37a08636670b
children 358a330c9931
line wrap: on
line diff
--- a/lisp/files.el	Thu Apr 29 20:26:46 1999 +0000
+++ b/lisp/files.el	Thu Apr 29 20:28:43 1999 +0000
@@ -1046,8 +1046,10 @@
 	   (or (run-hook-with-args-until-success 'find-file-not-found-hooks)
 	       ;; If they fail too, set error.
 	       (setq error t)))))
-      ;; Find the file's truename, and maybe use that as visited name.
-      (setq buffer-file-truename truename)
+      ;; Record the file's truename, and maybe use that as visited name.
+      (if (equal filename buffer-file-name)
+	  (setq buffer-file-truename truename)
+	(setq buffer-file-truename (file-truename buffer-file-name)))
       (setq buffer-file-number number)
       ;; On VMS, we may want to remember which directory in a search list
       ;; the file was found in.
@@ -1063,7 +1065,7 @@
 		(setq filename
 		      (expand-file-name buffer-file-truename))))
       ;; Set buffer's default directory to that of the file.
-      (setq default-directory (file-name-directory filename))
+      (setq default-directory (file-name-directory buffer-file-name))
       ;; Turn off backup files for certain file names.  Since
       ;; this is a permanent local, the major mode won't eliminate it.
       (and (not (funcall backup-enable-predicate buffer-file-name))