master 21c979ee608: vc-dir-mode: Tidy handling of read-only status

Sean Whitton <[email protected]> Thu, 23 Jul 2026 15:43:31 -0400 (EDT)
Newsgroups gmane.emacs.diffs
Message-ID <[email protected]>
branch: master
commit 21c979ee6088da645636f8751ad873c38dad830f
Author: Sean Whitton <[email protected]>
Commit: Sean Whitton <[email protected]>

    vc-dir-mode: Tidy handling of read-only status
    
    * lisp/vc/vc-dir.el (vc-dir-mode): Delete unneeded binding of
    buffer-read-only in :after-hook.  Bind inhibit-read-only instead
    of buffer-read-only.
---
 lisp/vc/vc-dir.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index deac4cde4a9..0b0671a8030 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -1479,7 +1479,7 @@ the *vc-dir* buffer.
   ;; modes are activated before the calls to `substitute-command-keys'
   ;; in `vc-dir-headers'.  Then any bindings shadowed by minor modes
   ;; won't be included in the key binding hints.
-  :after-hook (let (buffer-read-only) (vc-dir-refresh))
+  :after-hook (vc-dir-refresh)
   (setq-local vc-dir-backend use-vc-backend)
   (setq-local desktop-save-buffer 'vc-dir-desktop-buffer-misc-data)
   (setq-local bookmark-make-record-function #'vc-dir-bookmark-make-record)
@@ -1487,7 +1487,7 @@ the *vc-dir* buffer.
   (setq buffer-read-only t)
   (when (boundp 'tool-bar-map)
     (setq-local tool-bar-map vc-dir-tool-bar-map))
-  (let (buffer-read-only)
+  (let ((inhibit-read-only t))
     (erase-buffer)
     (setq-local vc-dir-process-buffer nil)
     (setq-local vc-ewoc (ewoc-create #'vc-dir-printer))