]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/vc/vc.el (vc-find-revision-no-save): Call read-only-mode.
authorSean Whitton <spwhitton@spwhitton.name>
Wed, 9 Jul 2025 10:43:49 +0000 (11:43 +0100)
committerEshel Yaron <me@eshelyaron.com>
Thu, 24 Jul 2025 07:54:33 +0000 (09:54 +0200)
(cherry picked from commit 72eb20f93f1b7693b54d21081235dfb804c94adc)

lisp/vc/vc.el

index bfeba44c5fac87ff8b089a3fb76b8a8ee7c6be40..45095a331ed09bac2547326489141a818c375708 100644 (file)
@@ -2752,12 +2752,7 @@ Unlike `vc-find-revision-save', doesn't save the buffer to the file."
                   ;; to not ignore 'enable-local-variables' when nil.
                   (normal-mode (not enable-local-variables)))
                (set-buffer-modified-p nil)
-                (setq buffer-read-only t)
-                (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))
+                (read-only-mode 1)
                 (setq failed nil))
            (when (and failed (unless buffer (get-file-buffer filename)))
              (with-current-buffer (get-file-buffer filename)