1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 14:30:50 -08:00

* lisp/vc/vc.el (vc-find-revision-no-save): Call read-only-mode.

This commit is contained in:
Sean Whitton 2025-07-09 11:43:49 +01:00
parent 8b86978895
commit 72eb20f93f

View file

@ -2757,12 +2757,7 @@ Unlike `vc-find-revision-save', doesn't save the buffer to the file."
;; to not ignore 'enable-local-variables' when nil. ;; to not ignore 'enable-local-variables' when nil.
(normal-mode (not enable-local-variables))) (normal-mode (not enable-local-variables)))
(set-buffer-modified-p nil) (set-buffer-modified-p nil)
(setq buffer-read-only t) (read-only-mode 1)
(run-hooks 'read-only-mode-hook)
(when (and view-read-only
(not view-mode)
(not (eq (get major-mode 'mode-class) 'special)))
(view-mode-enter))
(setq failed nil)) (setq failed nil))
(when (and failed (unless buffer (get-file-buffer filename))) (when (and failed (unless buffer (get-file-buffer filename)))
(with-current-buffer (get-file-buffer filename) (with-current-buffer (get-file-buffer filename)