I want to set C-c j
with such a function (called cmd
), which can handle subsequent keystrokes.
For example, after typing C-c j
Emacs will execute cmd
, then every subsequent j
will invoke cmd
again.
Any non-j
keystroke will interrupt this process. It won't invoke cmd
; instead, it acts like a simple keystroke without the prefix C-c
.
Another example is S-<arrow-key>
:
11.6 Shift Selection:
If you set
shift-select-mode
to the valuepermanent
, cursor motion keys that were not shift-translated will not deactivate the mark, so, for example, the region set by prior commands can be extended by shift-selection, and unshifted cursor motion keys will extend the region set by shift-selection.
C-x z
; for the 2nd one, in addition to omitting that key sequence, it distributes subsequent keystrokes to a set of relevant commands. Or, the functionality shown in the 2nd example can meet the need in the 1st example. I think I didn't make it clear enough in the question description, sorry for that ... But, anyway, answers providing either the first or second functionality is useful; they're helpful to the person who browses the related topic.