From aa2ac20c576119690fb9ef9cd780610d7ee7a293 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 25 Jan 2003 19:45:16 +0000 Subject: [PATCH] Document that a symbol can act as a keymap. --- lispref/keymaps.texi | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lispref/keymaps.texi b/lispref/keymaps.texi index 5102800d15e..be231798c43 100644 --- a/lispref/keymaps.texi +++ b/lispref/keymaps.texi @@ -103,8 +103,9 @@ for details. A keymap is a list whose @sc{car} is the symbol @code{keymap}. The remaining elements of the list define the key bindings of the keymap. -Use the function @code{keymapp} (see below) to test whether an object is -a keymap. +A symbol whose function definition is a keymap is also a keymap. Use +the function @code{keymapp} (see below) to test whether an object is a +keymap. Several kinds of elements may appear in a keymap, after the symbol @code{keymap} that begins it: @@ -202,7 +203,8 @@ lisp-mode-map @defun keymapp object This function returns @code{t} if @var{object} is a keymap, @code{nil} otherwise. More precisely, this function tests for a list whose -@sc{car} is @code{keymap}. +@sc{car} is @code{keymap}, or for a symbol whose function definition +satisfies @code{keymapp}. @example @group @@ -210,6 +212,11 @@ otherwise. More precisely, this function tests for a list whose @result{} t @end group @group +(fset 'foo '(keymap)) +(keymapp 'foo) + @result{} t +@end group +@group (keymapp (current-global-map)) @result{} t @end group -- 2.39.2