Mercurial > emacs
changeset 39593:d6db1ae8176b
(find-file-noselect): If file's read-only status has
changed on disk, ask if buffer's read-only status should be
changed, unless NOWARN is set.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Fri, 05 Oct 2001 12:10:57 +0000 |
parents | e89bde7c2dd0 |
children | ad301d019554 |
files | lisp/files.el |
diffstat | 1 files changed, 13 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/files.el Fri Oct 05 11:54:13 2001 +0000 +++ b/lisp/files.el Fri Oct 05 12:10:57 2001 +0000 @@ -1069,6 +1069,19 @@ (with-current-buffer buf (revert-buffer t t))))) (with-current-buffer buf + + ;; Check if a formerly read-only file has become + ;; writable and vice versa. + (let ((read-only (not (file-writable-p buffer-file-name)))) + (unless (eq read-only buffer-read-only) + (when (or nowarn + (let ((question + (format "File %s is %s on disk. Change buffer mode? " + buffer-file-name + (if read-only "read-only" "writable")))) + (y-or-n-p question))) + (setq buffer-read-only read-only)))) + (when (not (eq (not (null rawfile)) (not (null find-file-literally)))) (if (buffer-modified-p)