Mercurial > emacs
changeset 63810:f2cc7f306afb
(Creating Keymaps): Put make-sparse-keymap before make-keymap.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 28 Jun 2005 18:51:02 +0000 |
parents | e1784c56cee5 |
children | 83d11267d399 |
files | lispref/keymaps.texi |
diffstat | 1 files changed, 22 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/lispref/keymaps.texi Tue Jun 28 06:37:26 2005 +0000 +++ b/lispref/keymaps.texi Tue Jun 28 18:51:02 2005 +0000 @@ -257,13 +257,31 @@ Here we describe the functions for creating keymaps. -@c ??? This should come after make-sparse-keymap +@defun make-sparse-keymap &optional prompt +This function creates and returns a new sparse keymap with no entries. +(A sparse keymap is the kind of keymap you usually want.) The new +keymap does not contain a char-table, unlike @code{make-keymap}, and +does not bind any events. + +@example +@group +(make-sparse-keymap) + @result{} (keymap) +@end group +@end example + +If you specify @var{prompt}, that becomes the overall prompt string for +the keymap. The prompt string should be provided for menu keymaps +(@pxref{Defining Menus}). +@end defun + @defun make-keymap &optional prompt This function creates and returns a new full keymap. That keymap contains a char-table (@pxref{Char-Tables}) with slots for all characters without modifiers. The new keymap initially binds all these characters to @code{nil}, and does not bind any other kind of -event. +event. The argument @var{prompt} specifies a +prompt string, as in @code{make-sparse-keymap}. @example @group @@ -272,23 +290,8 @@ @end group @end example -If you specify @var{prompt}, that becomes the overall prompt string for -the keymap. The prompt string should be provided for menu keymaps -(@pxref{Defining Menus}). -@end defun - -@defun make-sparse-keymap &optional prompt -This function creates and returns a new sparse keymap with no entries. -The new keymap does not contain a char-table, unlike @code{make-keymap}, -and does not bind any events. The argument @var{prompt} specifies a -prompt string, as in @code{make-keymap}. - -@example -@group -(make-sparse-keymap) - @result{} (keymap) -@end group -@end example +A full keymap is more efficient than a sparse keymap when it holds +lots of bindings; for just a few, the sparse keymap is better. @end defun @defun copy-keymap keymap