Commit 944ef994 authored by Richard M. Stallman's avatar Richard M. Stallman

(find-file-noselect): Signal error if file is unreadable.

parent bb760c71
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment