diff options
Diffstat (limited to 'lisp/files.el')
-rw-r--r-- | lisp/files.el | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/files.el b/lisp/files.el index cf2a5221930..8596d9a8390 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -6627,9 +6627,14 @@ 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) + (state (and (boundp 'read-only-mode--state) + (list read-only-mode--state)))) (funcall (or revert-buffer-function #'revert-buffer--default) - ignore-auto noconfirm))) + ignore-auto noconfirm) + (when state + (setq buffer-read-only (car state)) + (setq-local read-only-mode--state (car state))))) (defun revert-buffer--default (ignore-auto noconfirm) "Default function for `revert-buffer'. |