]> git.eshelyaron.com Git - emacs.git/commitdiff
Make revert-buffer preserve buffer-readedness
authorLars Ingebrigtsen <larsi@gnus.org>
Thu, 22 Jul 2021 14:24:58 +0000 (16:24 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 22 Jul 2021 14:24:58 +0000 (16:24 +0200)
* lisp/files.el (revert-buffer): Preserve buffer-readedness
(bug#35166).

etc/NEWS
lisp/files.el

index bf19c34f02131b8bc1a276bc1dc3f71a24b2e044..95218faa1b6a4382c48664369ddec71a0684fa5e 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2804,6 +2804,9 @@ similar to prefix arguments, but are more flexible and discoverable.
 \f
 * Incompatible Editing Changes in Emacs 28.1
 
+** 'revert-buffer' will now preserve buffer-readedness.
+It previously switched the read-only flag off.
+
 ** 'electric-indent-mode' now also indents inside strings and comments,
 (unless the indentation function doesn't, of course).
 To recover the previous behavior you can use:
index 0606ed64823fcd0ae4b3a9765000a036e1a2d22b..412562fc9a365b1a720cdbf6dc8a30c9a095ca56 100644 (file)
@@ -6317,7 +6317,9 @@ preserve markers and overlays, at the price of being slower."
   ;; interface, but leaving the programmatic interface the same.
   (interactive (list (not current-prefix-arg)))
   (let ((revert-buffer-in-progress-p t)
-        (revert-buffer-preserve-modes preserve-modes))
+        (revert-buffer-preserve-modes preserve-modes)
+        ;; Preserve buffer-readedness.
+        (buffer-read-only buffer-read-only))
     (funcall (or revert-buffer-function #'revert-buffer--default)
              ignore-auto noconfirm)))