aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-12-21 02:10:01 +0000
committerRichard M. Stallman1997-12-21 02:10:01 +0000
commit944ef99444a1843440cd7f8bb7b45f974177935e (patch)
tree8ea5442eb8abe54a2e3abf771755a61f03f193bd
parentbb760c71f4ca5c0c60b9543e94a1bced38f0216e (diff)
downloademacs-944ef99444a1843440cd7f8bb7b45f974177935e.tar.gz
emacs-944ef99444a1843440cd7f8bb7b45f974177935e.zip
(find-file-noselect): Signal error if file is unreadable.
-rw-r--r--lisp/files.el8
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.