You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And whenever making special modes like this, it would be beneficial to extract the prefix's map (which has a superset of keymap information) and then modify the keymap for any commands that shouldn't be bound.
What concerns should come up during the implementation? Since a regular keymap is usually not dynamic like transients are during each setup, I believe logic that deactivates keys situationally for the transient UI should be bypassed, meaning a special mode map derived from a transient always has the full set of keys bound and nothing hidden / inapt.
The text was updated successfully, but these errors were encountered:
And whenever making special modes like this, it would be beneficial to extract the prefix's map (which has a superset of keymap information) and then modify the keymap for any commands that shouldn't be bound.
I am planing to eventually do something along those lines, but I would probably go the other way. I.e., add a :keymap argument to the prefix and allow suffixes to have no key defined. The key binding would then be looked up in the specified keymap.
One potential benefit of that approach could be that the binding could be changed using keymap-set/define-key instead of the less familiar transient-specific functions. However the main benefit I see and my motivation for adding such a feature, is that it would allow defining prefixes that just show information about the bindings that are available in the currently active keymaps, using transient's buffer. Think which-key but with the added benefit that related commands could be grouped instead of just showing an alphabetic list.
Sounds good. The transient spec would just need to map commands to descriptions.
A modification mechanism for the transient's spec will need to exist. Something more high-level than transient-insert-suffix Would be nice if the modification expressions are very similar to the original declaration expressions, a merging declaration style.
Personally I would prefer certain keys sequences never to be bound. I think it's unlikely that people will want to use long sequences in a modal dialog, and that means transient might also have a need for reducing key sequences while also avoiding ones the user hates. Whether independent or not, I sense a need for mass keymap re-writing, automatic keymap munging.
I was going to work on an automated special mode adapter a while back but realized that automatically generating these mappings didn't seem viable for enough situations.
IIRC magit still binds the status buffer independently from the transient definition even though it's mostly the same.
I'm writing some code that goes like this:
And whenever making special modes like this, it would be beneficial to extract the prefix's map (which has a superset of keymap information) and then modify the keymap for any commands that shouldn't be bound.
What concerns should come up during the implementation? Since a regular keymap is usually not dynamic like transients are during each setup, I believe logic that deactivates keys situationally for the transient UI should be bypassed, meaning a special mode map derived from a transient always has the full set of keys bound and nothing hidden / inapt.
The text was updated successfully, but these errors were encountered: