mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-30 04:10:54 -08:00
(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.
This commit is contained in:
parent
f2e7e23e00
commit
a8d002d2a6
1 changed files with 13 additions and 0 deletions
|
|
@ -1069,6 +1069,19 @@ that are visiting the various files."
|
|||
(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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue