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

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

RE: Showing all sequences bound to a prefix?


From: Drew Adams
Subject: RE: Showing all sequences bound to a prefix?
Date: Wed, 2 Sep 2009 08:04:33 -0700

> how can you know all keybindings which start with a key? For instance,
> "C-h c" asks me to enter a key. If I enter "C-w" it waits for more
> input, which means that "C-w" is a prefix.

Icicles key completion. 
http://www.emacswiki.org/emacs/Icicles_-_Key_Completion

(BTW, C-w is not normally a prefix key in Emacs. You or some library you load
has defined it as a prefix key.)

If C-w is a prefix key for you, then C-w S-TAB shows you all of the completions
for C-w: each suffix key with its associated command. Similarly, `C-x r S-TAB'
shows all of the completions of prefix key `C-x r':

..
+  =  increment-register
b  =  bookmark-jump
c  =  clear-rectangle
C-@  =  point-to-register
C-SPC  =  point-to-register
d  =  delete-rectangle
f  =  frame-configuration-to-register
g  =  insert-register
i  =  insert-register
j  =  jump-to-register
k  =  kill-rectangle
l  =  bookmark-bmenu-list
n  =  number-to-register
o  =  open-rectangle
r  =  copy-rectangle-to-register
s  =  copy-to-register
SPC  =  point-to-register
t  =  string-rectangle
w  =  window-configuration-to-register
x  =  copy-to-register
y  =  yank-rectangle

While completing, you can get the full help (in *Help*) for any key/command, by
cycling to it and hitting `C-M-RET'. For example, cycling to the third
completion, `c  = clear-rectangle', and hitting `C-M-RET', shows this:

,----
| clear-rectangle is an interactive autoloaded Lisp function in `rect'.
| 
| It is bound to C-x r c.
| 
| (clear-rectangle START END &optional FILL)
| 
| Blank out the region-rectangle.
| The text previously in the region is overwritten with blanks.
| 
| When called from a program the rectangle's corners are START and END.
| With a prefix (or a FILL) argument, also fill with blanks the parts of the
| rectangle which were empty.
| 
`----

You don't need to cycle - you can use completion instead. And you can filter
completion candidates by just typing some text. For example, type `rect' to
narrow the completions of `C-x r' to those keys that act on rectangles:

c  =  clear-rectangle
d  =  delete-rectangle
k  =  kill-rectangle
o  =  open-rectangle 
r  =  copy-rectangle-to-register
t  =  string-rectangle
y  =  yank-rectangle

Once you've chosen a completion, hit RET to use it, or C-g to quit. IOW, you can
use this either to complete a key, performing its action, or just to get help on
keys.





reply via email to

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