From: Richard M. Stallman Date: Sun, 21 Dec 1997 02:10:01 +0000 (+0000) Subject: (find-file-noselect): Signal error if file is unreadable. X-Git-Tag: emacs-20.3~2582 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=944ef99444a1843440cd7f8bb7b45f974177935e;p=emacs.git (find-file-noselect): Signal error if file is unreadable. --- 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." (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.