summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2026-05-30 13:17:00 +0300
committerEli Zaretskii <eliz@gnu.org>2026-05-30 13:17:00 +0300
commit69fd4b87f4db6acfb3f207db3f1673a5b6866d70 (patch)
tree8a7bb395ff9f3a8728d0e120ee04d5d056194e4a /lisp
parent2955b51e80c189d9a9de47ff27fa16f08671dcb8 (diff)
Don't make buffer read-only when reverting if 'view-mode' was disabled
* lisp/view.el (view--disable): Reset 'read-only-mode--state'. (Bug#81149)
Diffstat (limited to 'lisp')
-rw-r--r--lisp/view.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/lisp/view.el b/lisp/view.el
index ec69699108a..4e2e1f54c76 100644
--- a/lisp/view.el
+++ b/lisp/view.el
@@ -464,6 +464,10 @@ Entry to view-mode runs the normal hook `view-mode-hook'."
;; so that View mode stays off if read-only-mode is called.
(if (local-variable-p 'view-read-only)
(kill-local-variable 'view-read-only))
+ ;; Reset the read-only state memory as well, so that 'revert-buffer'
+ ;; won't make the buffer read-only again.
+ (if (local-variable-p 'read-only-mode--state)
+ (setq-local read-only-mode--state nil))
(if buffer-read-only
(setq buffer-read-only view-old-buffer-read-only)))