From 944ef99444a1843440cd7f8bb7b45f974177935e Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 21 Dec 1997 02:10:01 +0000 Subject: (find-file-noselect): Signal error if file is unreadable. --- lisp/files.el | 8 ++++++++ 1 file changed, 8 insertions(+) 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. -- cgit v1.2.3