GNU bug report logs -
#74140
[PATCH] Add :continue-only directive for repeat maps in bind-keys, use-package
Previous Next
Reported by: Paul Nelson <ultrono <at> gmail.com>
Date: Thu, 31 Oct 2024 17:37:02 UTC
Severity: wishlist
Tags: patch
Fixed in version 31.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
>> > > With this patch, the available directives are:
>> > > :continue (default) - activates and continues
>> > > :exit - neither activates nor continues
>> > > :continue-only (new) - continues, but does not activate
>> >
>> > How does this map to the properties ':enter' and ':exit' of 'defvar-keymap'?
>>
>> :exit has the same meaning in both.
>>
>> In defvar-keymap, :enter means "activate, but do not continue".
>
> Another difference is that :enter from defvar-keymap does not actually
> bind a key in the keymap, thus:
>
> activate continue bind
> :continue yes yes yes
> :continue-only no yes yes
> :exit no no yes
> :enter yes no no
Thanks, this table provides a clear overview.
So bind-keys doesn't need :enter? Ok.
Since defvar-keymap uses :continue by default,
what is missing in defvar-keymap is :continue-only.
For adding :continue-only to defvar-keymap
I looked how you implemented it for bind-keys,
and it seems making an alias doesn't look
like a clean solution.
I know that 'define-repeat-map' makes an alias as well.
So some time ago I had one idea how such aliases
could be avoided. The solution would be to put
a new property like this:
(put 'yank 'repeat-continue-keys '("y"))
(put 'undo 'repeat-continue-keys '("C-/"))
Its semantics is that when such a property exists
then repeat-mode will check if the last typed keys
don't exist in this list, only then the repeat map
should be activated.
Then bind-keys could put such new properties
from the definition like in your example:
:continue-only
;; These commands will be available during paragraph manipulation
;; but won't activate paragraph-repeat-map themselves
("y" . yank)
("C-/" . undo)
Do you think such a symbol property would cover all possible uses?
This bug report was last modified 140 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.