]> git.eshelyaron.com Git - emacs.git/commitdiff
(find-file-noselect): Signal error if file is unreadable.
authorRichard M. Stallman <rms@gnu.org>
Sun, 21 Dec 1997 02:10:01 +0000 (02:10 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sun, 21 Dec 1997 02:10:01 +0000 (02:10 +0000)
lisp/files.el

index 18aa7d85891f54f1508e7780f3c6785f83f05182..41f3c2d237ef2283ca8a1d657a4eb09df40d67b6 100644 (file)
@@ -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.