1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

; Simplify last change slightly, improve wording, add xref.

This commit is contained in:
Sean Whitton 2025-10-11 13:56:21 +01:00
parent 1170c27746
commit 2acd9702de

View file

@ -1074,8 +1074,10 @@ autoloaded from the given package. However, this does not work if one of
those commands is actually a keymap, since keymaps are not functions, those commands is actually a keymap, since keymaps are not functions,
and cannot be autoloaded using the built-in @code{autoload} function. and cannot be autoloaded using the built-in @code{autoload} function.
When you define a keymap using @code{defvar-keymap}, you make it behave When you define a keymap using @code{defvar-keymap} you can add the
as a function, including @code{:prefix t} in the keymap definition. required function definition by including @code{:prefix t} in the keymap
definition (@pxref{Creating Keymaps,,, elisp, GNU Emacs Lisp Reference
Manual}).
For example: For example:
@ -1088,13 +1090,13 @@ For example:
"B" #'foo-command-b) "B" #'foo-command-b)
(use-package foo (use-package foo
:bind (("C-c x" . foo-mode-exit) :bind (("C-c p" . foo-command-map)))
("C-c p" . foo-command-map)))
@end group @end group
@end lisp @end lisp
would create the bindings for the key sequences @code{"C-c p A"}, @noindent
@code{"C-c p B"} and @code{"C-c x"} for package @code{foo}. would create the bindings for the key sequences @code{"C-c p A"}, and
@code{"C-c p B"} for package @code{foo}.
@findex :bind-keymap @findex :bind-keymap
Alternatively, to handle this case, @code{use-package} offers a special, limited Alternatively, to handle this case, @code{use-package} offers a special, limited