您的位置:首页 > 其它

emacs key definition

2015-09-07 15:02 239 查看
Some Emacs commands are invoked by just one input event. Other commands take two or more input events to invokes, such as C-x 4 C-f.

A key sequence, or key for short, is a sequence of one or more input events that is meaningful as a unit.

If a key sequence invokes a command, we call it a complete key; for example, C-f, C-x C-f and C-x 4 C-f are all complete keys.

If a key sequence isn't long enough to invoke a command, we call it a prefix key; from the preceding example, we see that C-x and C-x 4 are prefix keys.

Every key sequence is either a complete key or a prefix key.

A prefix key combines with the following input event to make a longer key sequence.

For example, C-x is a prefix key, so typing C-x alone does not invoke a command; instead, Emacs waits for further input.

C-x combines with the next input event to make a two-event key sequence, which could itself be a prefix key (such as C-x 4), or a complete key (such as C-x C-f).

There is no limit to the length of key sequences, but in practice they are seldom longer than three or four input events.

You can't add input events onto a complete key. For example, because C-f is a complete key, the two-event sequence C-f C-k is two key sequenes, not one.

By default, the prefix keys in Emacs are:

C-c, C-h, C-x, C-x RET, C-x @, C-x a, C-x n, C-x r, C-x v, C-x 4, C-x 5, C-x 6,

ESC, M-g, and M-o. (F1 and F2 are aliases for C-h and C-x 6).

Typing the help character (C-h or F1) after a prefix key displays a list of the commands starting with that prefix.

The sole exception to this rule is ESC: ESC C-h is equivalent to C-M-h, which does something else entirely.

You can, however, use F1 to display a list of commands starting with ESC, ESC F1 NOT ESC C-h.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: