Mercurial > hg > xemacs-beta
comparison lisp/files.el @ 4655:13273cffca2a
Avoid errors in Dired when opening directories.
lisp/ChangeLog addition:
2009-07-18 Aidan Kehoe <kehoea@parhasard.net>
* files.el (find-file-create-switch-thunk):
Check that #'buffer-file-name gives non-nil before trying to
determine whether that file exists; avoids problems in
dired. Thank you Mats Lidell!
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sat, 18 Jul 2009 23:51:21 +0100 |
parents | 3972966a4588 |
children | 3c92890f3750 |
comparison
equal
deleted
inserted
replaced
4654:cdc51540fed7 | 4655:13273cffca2a |
---|---|
895 | 895 |
896 This function may be called from functions related to `find-file', as well | 896 This function may be called from functions related to `find-file', as well |
897 as `find-file' itself." | 897 as `find-file' itself." |
898 `(function | 898 `(function |
899 (lambda (buffer) | 899 (lambda (buffer) |
900 (unless (file-exists-p (buffer-file-name buffer)) | 900 (unless (and (buffer-file-name buffer) |
901 (file-exists-p (buffer-file-name buffer))) | |
901 ;; XEmacs: nonexistent file--qualifies as a modification to the | 902 ;; XEmacs: nonexistent file--qualifies as a modification to the |
902 ;; buffer. | 903 ;; buffer. |
903 (set-buffer-modified-p t buffer)) | 904 (set-buffer-modified-p t buffer)) |
904 (,switch-function buffer)))) | 905 (,switch-function buffer)))) |
905 | 906 |