From b2d239c1ba9d4472868f40bd82a555b9de702f3d Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 28 Nov 2006 02:20:32 +0000 Subject: [PATCH] (revert-buffer): Special error message if file is now not readable. --- lisp/files.el | 5 +++++ 1 file changed, 5 insertions(+) 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. -- 2.39.2