diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2011-10-07 12:22:04 -0400 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2011-10-07 12:22:04 -0400 |
commit | de0bde6284da06b603b578cc5d19002fd15f928d (patch) | |
tree | 17a8c6b94b18d9173ccf23fcf39e25efadc051a6 /doc/emacs/commands.texi | |
parent | c383327999c7bd66492878122fd2867acdeb9a23 (diff) | |
download | emacs-de0bde6284da06b603b578cc5d19002fd15f928d.tar.gz |
Copyedits and updates for Emacs manual's first few chapters.
* doc/emacs/basic.texi (Inserting Text): Add xref to Completion. Add
ucs-insert example, and document prefix argument.
(Moving Point): Fix introduction; C-f/C-b are no longer equivalent
to left/right. Tweak left-char and right-char descriptions.
M-left and M-right are now bound to left-word/right-word.
(Erasing): Document delete-forward-char.
* doc/emacs/commands.texi (User Input): Define "input event" more clearly.
(Keys): Add xref to Echo Area.
(Commands): Clarify relation between commands and functions.
* doc/emacs/entering.texi (Entering Emacs): Define "startup screen".
Document window-splitting behavior with command-line inputs.
(Exiting): Remove obsolete paragraph about shells without suspend
functionality.
* doc/emacs/frames.texi (Non-Window Terminals): Index just "text-only
terminal", which is used throughout the manual now.
* doc/emacs/screen.texi (Screen, Menu Bar): Copyedits.
(Point): Remove duplicate paragraph on cursors, also in Screen.
(Mode Line): Trailing dashes no longer shown on X displays.
Diffstat (limited to 'doc/emacs/commands.texi')
-rw-r--r-- | doc/emacs/commands.texi | 116 |
1 files changed, 52 insertions, 64 deletions
diff --git a/doc/emacs/commands.texi b/doc/emacs/commands.texi index cff725027e9..de6e7539c27 100644 --- a/doc/emacs/commands.texi +++ b/doc/emacs/commands.texi @@ -23,25 +23,21 @@ input. @cindex @acronym{ASCII} @cindex C- @cindex Control -@cindex control characters GNU Emacs is primarily designed for use with the keyboard. While it is possible to use the mouse to issue editing commands through the menu bar and tool bar, that is not as efficient as using the keyboard. Therefore, this manual mainly documents how to edit with the keyboard. +@cindex control character Keyboard input into Emacs is based on a heavily-extended version of -@acronym{ASCII}. The simplest characters that you can input into -Emacs correspond to graphic symbols such as @samp{a}, @samp{B}, -@samp{3}, @samp{=}, the space character (conventionally denoted as -@key{SPC}), and so on. Entering these using the keyboard is -straightforward. Certain characters found on non-English keyboards -also fall into this category (@pxref{International}). - - In addition to these simple characters, Emacs recognizes -@dfn{control characters} such as @key{RET}, @key{TAB}, @key{DEL}, -@key{ESC}, @key{F1}, @key{Home}, @key{left}, etc. Most keyboards have -special keys for entering these. +@acronym{ASCII}. Simple characters, like @samp{a}, @samp{B}, +@samp{3}, @samp{=}, and the space character (denoted as @key{SPC}), +are entered by typing the corresponding key. @dfn{Control +characters}, such as @key{RET}, @key{TAB}, @key{DEL}, @key{ESC}, +@key{F1}, @key{Home}, and @key{left}, are also entered this way, as +are certain characters found on non-English keyboards +(@pxref{International}). @cindex modifier keys @cindex Control @@ -50,13 +46,14 @@ special keys for entering these. @cindex M- Emacs also recognizes control characters that are entered using @dfn{modifier keys}. Two commonly-used modifier keys are -@key{Control} (which is usually labelled as @key{Ctrl}), and -@key{Meta} (which is usually labeled as @key{Alt})@footnote{We refer -to @key{Alt} as @key{Meta} for historical reasons.}. For example, -@kbd{Control-a} is entered by holding down the @key{Ctrl} key while -pressing @kbd{a}; we will refer to this as @kbd{C-a} for short. -Similarly @kbd{Meta-a}, or @kbd{M-a} for short, is entered by holding -down the @key{Alt} key and pressing @kbd{a}. +@key{Control} (usually labelled @key{Ctrl}), and @key{Meta} (usually +labeled @key{Alt})@footnote{We refer to @key{Alt} as @key{Meta} for +historical reasons.}. For example, @kbd{Control-a} is entered by +holding down the @key{Ctrl} key while pressing @kbd{a}; we will refer +to this as @kbd{C-a} for short. Similarly @kbd{Meta-a}, or @kbd{M-a} +for short, is entered by holding down the @key{Alt} key and pressing +@kbd{a}. Modifier keys can also be applied to non-alphanumerical +characters, e.g. @kbd{C-@key{F1}} or @kbd{M-@key{left}}. @cindex @key{ESC} replacing @key{Meta} key You can also type Meta characters using two-character sequences @@ -68,33 +65,28 @@ character; instead, press @key{ESC} and release it, then enter the next character. This feature is useful on certain text-only terminals where the @key{Meta} key does not function reliably. - Modifier keys can apply not only to alphanumerical characters, but -also to special input characters, such as the arrow keys and mouse -buttons. - -@cindex input event - @xref{Input Events,,, elisp, The Emacs Lisp Reference Manual}, for -the full Lisp-level details about keyboard and mouse input, which are -collectively referred to as @dfn{input events}. If you are not doing -Lisp programming, but simply want to redefine the meaning of some -characters or non-character events, see @ref{Customization}. - @cindex keys stolen by window manager @cindex window manager, keys stolen by - On graphical displays, the window manager is likely to block the -character @kbd{M-@key{TAB}} before Emacs can see it. It may also -block @kbd{M-@key{SPC}}, @kbd{C-M-d} and @kbd{C-M-l}. If you have -these problems, we recommend that you customize your window manager to -turn off those commands, or put them on key combinations that Emacs -does not use. + On graphical displays, the window manager might block some keyboard +inputs, including @kbd{M-@key{TAB}}, @kbd{M-@key{SPC}}, @kbd{C-M-d} +and @kbd{C-M-l}. If you have this problem, you can either customize +your window manager to not block those keys, or ``rebind'' the +affected Emacs commands (@pxref{Customization}). + +@cindex input event + Simple characters and control characters, as well as certain +non-keyboard inputs such as mouse clicks, are collectively referred to +as @dfn{input events}. For details about how Emacs internally handles +input events, see @ref{Input Events,,, elisp, The Emacs Lisp Reference +Manual}. @node Keys, Commands, User Input, Top @section Keys Some Emacs commands are invoked by just one input event; for -example, @kbd{C-f} moves forward one character in the buffer. But -Emacs also has commands that take two or more input events to invoke, -such as @kbd{C-x C-f} and @kbd{C-x 4 C-f}. +example, @kbd{C-f} moves forward one character in the buffer. Other +commands take two or more input events to invoke, such as @kbd{C-x +C-f} and @kbd{C-x 4 C-f}. @cindex key @cindex key sequence @@ -106,23 +98,23 @@ invokes a command, we call it a @dfn{complete key}; for example, @kbd{C-f}, @kbd{C-x C-f} and @kbd{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 @dfn{prefix key}; from the preceding example, we see that @kbd{C-x} -and @kbd{C-x 4} are prefix keys. Every key is either a complete key -or a prefix key. +and @kbd{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, which may itself be complete or a prefix. For -example, @kbd{C-x} is a prefix key, so @kbd{C-x} and the next input -event combine to make a two-event key sequence. This two-event key -sequence could itself be a prefix key (such as @kbd{C-x 4}), or a -complete key (such as @kbd{C-x C-f}). There is no limit to the length -of a key sequence, but in practice people rarely use sequences longer -than three or four input events. - - You can't add input events onto a complete key. For example, the -two-event sequence @kbd{C-f C-k} is not a key, because the @kbd{C-f} -is a complete key in itself, so @kbd{C-f C-k} cannot have an -independent meaning as a command. @kbd{C-f C-k} is two key sequences, -not one.@refill +longer key sequence. For example, @kbd{C-x} is a prefix key, so +typing @kbd{C-x} alone does not invoke a command; instead, Emacs waits +for further input (if you pause for longer than a second, it echoes +the @kbd{C-x} key to prompt for that input; @pxref{Echo Area}). +@kbd{C-x} combines with the next input event to make a two-event key +sequence, which could itself be a prefix key (such as @kbd{C-x 4}), or +a complete key (such as @kbd{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 @kbd{C-f} is a complete key, the two-event sequence @kbd{C-f +C-k} is two key sequences, not one. By default, the prefix keys in Emacs are @kbd{C-c}, @kbd{C-h}, @kbd{C-x}, @kbd{C-x @key{RET}}, @kbd{C-x @@}, @kbd{C-x a}, @kbd{C-x @@ -132,22 +124,20 @@ aliases for @kbd{C-h} and @kbd{C-x 6}.) This list is not cast in stone; if you customize Emacs, you can make new prefix keys. You could even eliminate some of the standard ones, though this is not recommended for most users; for example, if you remove the prefix -definition of @kbd{C-x 4}, then @kbd{C-x 4 @var{anything}} would -become an invalid key sequence. @xref{Key Bindings}. +definition of @kbd{C-x 4}, then @kbd{C-x 4 C-f} becomes an invalid key +sequence. @xref{Key Bindings}. Typing the help character (@kbd{C-h} or @key{F1}) after a prefix key displays a list of the commands starting with that prefix. The sole exception to this rule is @key{ESC}: @kbd{@key{ESC} C-h} is equivalent to @kbd{C-M-h}, which does something else entirely. You can, however, -use @key{F1} to displays a list of the commands starting with -@key{ESC}. +use @key{F1} to display a list of commands starting with @key{ESC}. @node Commands, Entering Emacs, Keys, Top @section Keys and Commands @cindex binding @cindex command -@cindex function definition This manual is full of passages that tell you what particular keys do. But Emacs does not assign meanings to keys directly. Instead, Emacs assigns meanings to named @dfn{commands}, and then gives keys @@ -155,11 +145,9 @@ their meanings by @dfn{binding} them to commands. Every command has a name chosen by a programmer. The name is usually made of a few English words separated by dashes; for example, -@code{next-line} or @code{forward-word}. A command also has a -@dfn{function definition} which is a Lisp program; this is how the -command does its work. In Emacs Lisp, a command is a Lisp function -with special properties that make it suitable for interactive use. -For more information on commands and functions, see @ref{What Is a +@code{next-line} or @code{forward-word}. Internally, each command is +a special type of Lisp @dfn{function}, and the actions associated with +the command are performed by running the function. @xref{What Is a Function,, What Is a Function, elisp, The Emacs Lisp Reference Manual}. |