]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't lose read-only marking when reverting a view-mode buffer
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 24 Aug 2022 11:39:08 +0000 (13:39 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 24 Aug 2022 11:39:41 +0000 (13:39 +0200)
* lisp/view.el (view--enable): Don't lose read-only-ness when
reverting (bug#35166).

lisp/view.el

index 287112f2d4497044e23a5eb004f8dd2c4f83bf84..1207f01db21d6c1d379892fbfb15e1bbc0f0d454 100644 (file)
@@ -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")