summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/files.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/lisp/files.el b/lisp/files.el
index a84844810cb..396e4c28b36 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4081,6 +4081,11 @@ non-nil, it is called instead of rereading visited file contents."
"File %s no longer exists!"
"Cannot revert nonexistent file %s")
file-name))
+ ((not (file-readable-p file-name))
+ (error (if buffer-file-number
+ "File %s no longer readable!"
+ "Cannot revert unreadable file %s")
+ file-name))
(t
;; Bind buffer-file-name to nil
;; so that we don't try to lock the file.