diff options
| -rw-r--r-- | lisp/files.el | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/files.el b/lisp/files.el index 18aa7d85891..41f3c2d237e 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -914,11 +914,19 @@ Optional second arg RAWFILE non-nil means the file is read literally." | |||
| 914 | (condition-case () | 914 | (condition-case () |
| 915 | (insert-file-contents-literally filename t) | 915 | (insert-file-contents-literally filename t) |
| 916 | (file-error | 916 | (file-error |
| 917 | (when (not (file-readable-p filename)) | ||
| 918 | (kill-buffer buf) | ||
| 919 | (signal 'file-error (list "File is not readable" | ||
| 920 | filename))) | ||
| 917 | ;; Unconditionally set error | 921 | ;; Unconditionally set error |
| 918 | (setq error t))) | 922 | (setq error t))) |
| 919 | (condition-case () | 923 | (condition-case () |
| 920 | (insert-file-contents filename t) | 924 | (insert-file-contents filename t) |
| 921 | (file-error | 925 | (file-error |
| 926 | (when (not (file-readable-p filename)) | ||
| 927 | (kill-buffer buf) | ||
| 928 | (signal 'file-error (list "File is not readable" | ||
| 929 | filename))) | ||
| 922 | ;; Run find-file-not-found-hooks until one returns non-nil. | 930 | ;; Run find-file-not-found-hooks until one returns non-nil. |
| 923 | (or (run-hook-with-args-until-success 'find-file-not-found-hooks) | 931 | (or (run-hook-with-args-until-success 'find-file-not-found-hooks) |
| 924 | ;; If they fail too, set error. | 932 | ;; If they fail too, set error. |