diff options
author | Richard M. Stallman <[email protected]> | 1997-12-21 02:10:01 +0000 |
---|---|---|
committer | Richard M. Stallman <[email protected]> | 1997-12-21 02:10:01 +0000 |
commit | 944ef99444a1843440cd7f8bb7b45f974177935e (patch) | |
tree | 8ea5442eb8abe54a2e3abf771755a61f03f193bd /lisp/files.el | |
parent | bb760c71f4ca5c0c60b9543e94a1bced38f0216e (diff) |
(find-file-noselect): Signal error if file is unreadable.
Diffstat (limited to 'lisp/files.el')
-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 18aa7d8589..41f3c2d237 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." (condition-case () (insert-file-contents-literally filename t) (file-error + (when (not (file-readable-p filename)) + (kill-buffer buf) + (signal 'file-error (list "File is not readable" + filename))) ;; Unconditionally set error (setq error t))) (condition-case () (insert-file-contents filename t) (file-error + (when (not (file-readable-p filename)) + (kill-buffer buf) + (signal 'file-error (list "File is not readable" + filename))) ;; Run find-file-not-found-hooks until one returns non-nil. (or (run-hook-with-args-until-success 'find-file-not-found-hooks) ;; If they fail too, set error. |