From 69fd4b87f4db6acfb3f207db3f1673a5b6866d70 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 30 May 2026 13:17:00 +0300 Subject: [PATCH] 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) --- lisp/view.el | 4 ++++ 1 file changed, 4 insertions(+) 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)))