help-gnu-emacs
[Top][All Lists]
Advanced

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

repeatable vs. non-repeatable commands


From: Michael Heerdegen
Subject: repeatable vs. non-repeatable commands
Date: Sat, 24 Jun 2017 08:17:26 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Hi,

in el-search, the default key bindings are all of the form
control-shift-letter, like C-S (search-forward), C-R (search-backward),
C-A (go to the first match) etc.

Since these bindings are not available in a console, I want to provide
another configurable binding-scheme of the form prefix+letter, where
"prefix" is a prefix key the user can choose.  In this case, I want to
equip the commands with a transient map so that the prefix has to be
given only the first time one of the commands is invoked.  For example,
if the prefix is meta-s e,

   meta-s e s s a

should invoke a forward search, then go to the next match, and then to
the first.

The transient map is the same for all prefixes, but in the shift-letter
case, it's wrong to use the transient map; it would be surprising when
C-S followed by r would search backward instead of stopping the search
and invoking the self-insert-command.

My question is: is there a way I'm not seeing to achieve this without
defining two sets of commands (one set establishing the transient map,
another without)?

FWIW, my idea was consulting `this-command-keys', but due to bug#27470,
I can't use it in my case.

Any ideas?


Thanks,

Michael.



reply via email to

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