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: Juri Linkov
Subject: Re: Duplicated outline-cycle binding, and problems with the new one
Date: Wed, 05 Jan 2022 20:35:56 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)

>>> Overall, from my limited knowledge, I think the old approach is more
>>> reliable: I wouldn’t have this problem with the old approach.  And the
>>> new functionality added by the new approach and
>>> outline-minor-mode-cycle-filter can be easily implemented in the old
>>> approach.  We don’t need to fiddle with font-lock-keywords with the
>>> old approach, either.  How about we go back to the old approach?
>>
>> Some time ago we discussed this possibility, but it will require writing
>> too many wrappers for different modes, for example, for diff-mode:
>
> Why?  The old approach used a conditional binding, so it should "just
> work" without the major modes knowing about it.

Unfortunately, this is impossible to do.  When using

  (define-minor-mode outline-minor-mode
    :keymap (easy-mmode-define-keymap
             `(([menu-bar] . ,outline-minor-mode-menu-bar-map)
               (,outline-minor-mode-prefix . ,outline-mode-prefix-map))
             :inherit outline-minor-mode-cycle-map)

it updates minor-mode-map-alist with the keymap where the TAB key
is bound to outline-cycle in outline-minor-mode-cycle-map.

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:

  (let ((ro-bind (cons 'buffer-read-only diff-mode-shared-map)))
    (add-to-list 'minor-mode-overriding-map-alist ro-bind)

so TAB bound to outline-cycle can't be used on outline headings
in read-only diff buffers.



reply via email to

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