From 25ee1ff2065d7421295e3ff6912538c84084c32c Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 24 Aug 2022 13:39:08 +0200 Subject: [PATCH] Don't lose read-only marking when reverting a view-mode buffer * lisp/view.el (view--enable): Don't lose read-only-ness when reverting (bug#35166). --- lisp/view.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/view.el b/lisp/view.el index 287112f2d44..1207f01db21 100644 --- a/lisp/view.el +++ b/lisp/view.el @@ -441,7 +441,9 @@ Entry to view-mode runs the normal hook `view-mode-hook'." (setq view-page-size nil view-half-page-size nil view-old-buffer-read-only buffer-read-only - buffer-read-only t)) + buffer-read-only t) + ;; Make reverting the buffer preserve unreadableness. + (setq-local read-only-mode--state t)) (define-obsolete-function-alias 'view-mode-enable 'view-mode "24.4") -- 2.39.2