From: Lars Ingebrigtsen Date: Wed, 24 Aug 2022 11:39:08 +0000 (+0200) Subject: Don't lose read-only marking when reverting a view-mode buffer X-Git-Tag: emacs-29.0.90~1893^2~61 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=25ee1ff2065d7421295e3ff6912538c84084c32c;p=emacs.git 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). --- 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")