diff options
| author | Karl Heuer | 1999-04-29 20:28:43 +0000 |
|---|---|---|
| committer | Karl Heuer | 1999-04-29 20:28:43 +0000 |
| commit | b120e7136dc94932ed1f521820096195ce212d33 (patch) | |
| tree | 78c4daf5c51403283745a04757f97792ccc27ed0 | |
| parent | 0343a01795fdcedba5c46e67a3527e7074f7a990 (diff) | |
| download | emacs-b120e7136dc94932ed1f521820096195ce212d33.tar.gz emacs-b120e7136dc94932ed1f521820096195ce212d33.zip | |
(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.
| -rw-r--r-- | lisp/files.el | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/files.el b/lisp/files.el index ace250533d8..d2ad4d889f6 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -1046,8 +1046,10 @@ that are visiting the various files." | |||
| 1046 | (or (run-hook-with-args-until-success 'find-file-not-found-hooks) | 1046 | (or (run-hook-with-args-until-success 'find-file-not-found-hooks) |
| 1047 | ;; If they fail too, set error. | 1047 | ;; If they fail too, set error. |
| 1048 | (setq error t))))) | 1048 | (setq error t))))) |
| 1049 | ;; Find the file's truename, and maybe use that as visited name. | 1049 | ;; Record the file's truename, and maybe use that as visited name. |
| 1050 | (setq buffer-file-truename truename) | 1050 | (if (equal filename buffer-file-name) |
| 1051 | (setq buffer-file-truename truename) | ||
| 1052 | (setq buffer-file-truename (file-truename buffer-file-name))) | ||
| 1051 | (setq buffer-file-number number) | 1053 | (setq buffer-file-number number) |
| 1052 | ;; On VMS, we may want to remember which directory in a search list | 1054 | ;; On VMS, we may want to remember which directory in a search list |
| 1053 | ;; the file was found in. | 1055 | ;; the file was found in. |
| @@ -1063,7 +1065,7 @@ that are visiting the various files." | |||
| 1063 | (setq filename | 1065 | (setq filename |
| 1064 | (expand-file-name buffer-file-truename)))) | 1066 | (expand-file-name buffer-file-truename)))) |
| 1065 | ;; Set buffer's default directory to that of the file. | 1067 | ;; Set buffer's default directory to that of the file. |
| 1066 | (setq default-directory (file-name-directory filename)) | 1068 | (setq default-directory (file-name-directory buffer-file-name)) |
| 1067 | ;; Turn off backup files for certain file names. Since | 1069 | ;; Turn off backup files for certain file names. Since |
| 1068 | ;; this is a permanent local, the major mode won't eliminate it. | 1070 | ;; this is a permanent local, the major mode won't eliminate it. |
| 1069 | (and (not (funcall backup-enable-predicate buffer-file-name)) | 1071 | (and (not (funcall backup-enable-predicate buffer-file-name)) |