]> git.eshelyaron.com Git - emacs.git/commitdiff
(revert-buffer): Special error message if file is now not readable.
authorRichard M. Stallman <rms@gnu.org>
Tue, 28 Nov 2006 02:20:32 +0000 (02:20 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 28 Nov 2006 02:20:32 +0000 (02:20 +0000)
lisp/files.el

index a84844810cb9f42f4bb1323220ece9e3ff2151da..396e4c28b36fb96f1b0d65162777504a671d86b8 100644 (file)
@@ -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.