emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Duplicated outline-cycle binding, and problems with the new one


From: Yuan Fu
Subject: Re: Duplicated outline-cycle binding, and problems with the new one
Date: Sun, 9 Jan 2022 14:55:45 -0800


> On Jan 6, 2022, at 10:56 AM, Juri Linkov <juri@linkov.net> wrote:
> 
>>> But diff-mode overrides this binding with diff-mode-shared-map
>>> where the TAB key is bound to diff-hunk-next, since
>>> minor-mode-overriding-map-alist takes priority over
>>> minor-mode-map-alist when diff-mode does this:
>> 
>> I see.  I knew using `minor-mode-overriding-map-alist` in `diff-mode.el`
>> this way was going to bite us sooner or later.
>> 
>> Maybe we should use a hook on `read-only-mode` to set/unset
>> a `diff-mode-read-only` variable so we can add the keymap
>> (conditionalized on this new `diff-mode-read-only`) to
>> `minor-mode-map-alist` instead of `minor-mode-overriding-map-alist`.
> 
> So this is because `minor-mode-map-alist` is not buffer-local.
> Then this requires changing `(setq buffer-read-only t)` to
> `(read-only-mode 1)` in diff-related places.  Since `read-only-mode`
> always activates `view-mode` when `view-read-only` is t,
> it needs let-binding: (let ((view-read-only nil)) (read-only-mode 1)).
> This will keep the current behavior.  Then special-handling of
> `view-mode` in `diff-mode` is not needed because `view-mode`
> is higher than `diff-mode-read-only` in `minor-mode-map-alist`,
> where `diff-mode-read-only` is at the end to not take precedence
> over `outline-minor-mode`.

Once again, LGTM :-)

Yuan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]