# HG changeset patch # User Karl Heuer # Date 925417723 0 # Node ID 0d75a033fcebca4acb5fd9991c86efd2c5cdbdfc # Parent f14a11549a6488553be63efc4c2df7ef7cab753c (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. diff -r f14a11549a64 -r 0d75a033fceb lisp/files.el --- 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))