]> git.eshelyaron.com Git - emacs.git/commit
Add diff-mode-read-only to enable shorter keys in diff-mode
authorJuri Linkov <juri@linkov.net>
Mon, 10 Jan 2022 18:29:53 +0000 (20:29 +0200)
committerJuri Linkov <juri@linkov.net>
Mon, 10 Jan 2022 18:29:53 +0000 (20:29 +0200)
commit97806bc7deeec7ab1458eb5ff689f46ec8e7c652
treee454d7c0aad622aa9639bb4b4d46f6ce067f05e7
parent2b7a486605c01f7927de47ec2788f1eb2a4c0142
Add diff-mode-read-only to enable shorter keys in diff-mode

To be able to use outline-minor-mode-cycle keys in diff-mode,
outline-minor-mode should be higher in minor-mode-map-alist,
and a new variable diff-mode-read-only should be set
when the diff-mode buffer is read-only.
https://lists.gnu.org/archive/html/emacs-devel/2022-01/msg00740.html

* lisp/vc/diff-mode.el: Add diff-mode-read-only to minor-mode-map-alist.
(diff-mode-read-only): New buffer-local variable.
(diff-mode): Set diff-mode-read-only to t when buffer-read-only is non-nil.
Update diff-mode-read-only in read-only-mode-hook.
Remove buffer-read-only from minor-mode-overriding-map-alist.
Remove view-mode-hook because now view-mode is higher than
diff-mode-read-only in minor-mode-map-alist.

* lisp/vc/vc-git.el (vc-git-stash-show):
* lisp/vc/vc.el (vc-diff-internal): Set buffer-read-only to t
before calling diff-mode that will set diff-mode-read-only.
lisp/vc/diff-mode.el
lisp/vc/vc-git.el
lisp/vc/vc.el