summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2023-01-21 09:50:59 +0200
committerEli Zaretskii <eliz@gnu.org>2023-01-21 09:50:59 +0200
commit9f5d6c541e55cafb431d8b1226c2d79074574bd6 (patch)
treea3885e673ceee7b46d1f6e2f0816e84deb4e9846
parenta91b435d0d543f747bbdbd359ab708a3bab67c71 (diff)
downloademacs-9f5d6c541e55cafb431d8b1226c2d79074574bd6.tar.gz
; * doc/emacs/custom.texi (Init Rebinding): Fix wording in last change.
-rw-r--r--doc/emacs/custom.texi49
1 files changed, 26 insertions, 23 deletions
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index 44c37d3ac83..ee818a74b57 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -1888,10 +1888,10 @@ you can specify them in your initialization file by writing Lisp code.
@xref{Init File}, for a description of the initialization file.
@findex keymap-global-set
- The recommended way to write a key binding using Lisp is to use one
-of the @code{keymap-global-set}, or @code{keymap-set} functions. For
-example, here's how to bind @kbd{C-z} to the @code{shell} command in
-the global keymap (@pxref{Interactive Shell}):
+ The recommended way to write a key binding using Lisp is to use
+either the @code{keymap-global-set} or the @code{keymap-set}
+functions. For example, here's how to bind @kbd{C-z} to the
+@code{shell} command in the global keymap (@pxref{Interactive Shell}):
@example
(keymap-global-set "C-z" 'shell)
@@ -1899,18 +1899,19 @@ the global keymap (@pxref{Interactive Shell}):
@cindex key sequence syntax
@noindent
-The second argument that describes the key sequence, is a string
-containing a series of characters separated by spaces with each
-character corresponding to a key. Keys with modifiers can be
-specified by prepending the modifier, such as @samp{C-} for Control,
-or @samp{M-} for Meta. Special keys, such as @kbd{TAB} and @kbd{RET},
-can be specified within angle brackets as in @kbd{@key{TAB}} and
-@kbd{@key{RET}}.
-
- The single-quote before the command name, @code{shell}, marks it as
-a constant symbol rather than a variable. If you omit the quote,
-Emacs would try to evaluate @code{shell} as a variable. This probably
-causes an error; it certainly isn't what you want.
+The first argument to @code{keymap-global-set} describes the key
+sequence. It is a string made of a series of characters separated
+by spaces, with each character corresponding to a key. Keys with
+modifiers can be specified by prepending the modifier, such as
+@samp{C-} for Control, or @samp{M-} for Meta. Special keys, such as
+@key{TAB} and @key{RET}, can be specified within angle brackets as in
+@kbd{@key{TAB}} and @kbd{@key{RET}}.
+
+ The single-quote before the command name that is being bound to the
+key sequence, @code{shell} in the above example, marks it as a
+constant symbol rather than a variable. If you omit the quote, Emacs
+would try to evaluate @code{shell} as a variable. This will probably
+cause an error; it certainly isn't what you want.
Here are some additional examples, including binding function keys
and mouse events:
@@ -1929,9 +1930,10 @@ non-@acronym{ASCII} characters. @xref{Init Non-ASCII}.
@findex global-set-key
@findex define-key
- Alternatively you can use the low level functions @code{define-key}
-and @code{global-set-key}. For example to bind @kbd{C-z} to the
-@code{shell} command as in the above example, use:
+ Alternatively, you can use the low level functions @code{define-key}
+and @code{global-set-key}. For example, to bind @kbd{C-z} to the
+@code{shell} command, as in the above example, using these low-level
+functions, use:
@example
(global-set-key (kbd "C-z") 'shell)
@@ -1941,10 +1943,11 @@ and @code{global-set-key}. For example to bind @kbd{C-z} to the
@noindent
There are various ways to specify the key sequence but the simplest is
to use the function @code{kbd} as shown in the example above.
-@code{kbd} takes a single string argument specifying a key sequence in
-the syntax described earlier for @code{keymap-global-set}. For more
-details about binding keys using Lisp @ref{Keymaps,,, elisp, The Emacs
-Lisp Reference Manual}.
+@code{kbd} takes a single string argument that is a textual
+representation of a key sequence, and converts it into a form suitable
+for low-level functions such as @code{global-set-key}. For more
+details about binding keys using Lisp, @pxref{Keymaps,,, elisp, The
+Emacs Lisp Reference Manual}.
@findex keymap-set
@findex keymap-unset