diff options
| author | Richard M. Stallman | 2003-01-25 19:45:16 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2003-01-25 19:45:16 +0000 |
| commit | aa2ac20c576119690fb9ef9cd780610d7ee7a293 (patch) | |
| tree | 36c2b507498b7053a55559dfc06417327bca2b8a | |
| parent | 347a36bc5bd7d078c83da6a83397738f839c58b7 (diff) | |
| download | emacs-aa2ac20c576119690fb9ef9cd780610d7ee7a293.tar.gz emacs-aa2ac20c576119690fb9ef9cd780610d7ee7a293.zip | |
Document that a symbol can act as a keymap.
| -rw-r--r-- | lispref/keymaps.texi | 13 |
1 files 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. | |||
| 103 | 103 | ||
| 104 | A keymap is a list whose @sc{car} is the symbol @code{keymap}. The | 104 | A keymap is a list whose @sc{car} is the symbol @code{keymap}. The |
| 105 | remaining elements of the list define the key bindings of the keymap. | 105 | remaining elements of the list define the key bindings of the keymap. |
| 106 | Use the function @code{keymapp} (see below) to test whether an object is | 106 | A symbol whose function definition is a keymap is also a keymap. Use |
| 107 | a keymap. | 107 | the function @code{keymapp} (see below) to test whether an object is a |
| 108 | keymap. | ||
| 108 | 109 | ||
| 109 | Several kinds of elements may appear in a keymap, after the symbol | 110 | Several kinds of elements may appear in a keymap, after the symbol |
| 110 | @code{keymap} that begins it: | 111 | @code{keymap} that begins it: |
| @@ -202,7 +203,8 @@ lisp-mode-map | |||
| 202 | @defun keymapp object | 203 | @defun keymapp object |
| 203 | This function returns @code{t} if @var{object} is a keymap, @code{nil} | 204 | This function returns @code{t} if @var{object} is a keymap, @code{nil} |
| 204 | otherwise. More precisely, this function tests for a list whose | 205 | otherwise. More precisely, this function tests for a list whose |
| 205 | @sc{car} is @code{keymap}. | 206 | @sc{car} is @code{keymap}, or for a symbol whose function definition |
| 207 | satisfies @code{keymapp}. | ||
| 206 | 208 | ||
| 207 | @example | 209 | @example |
| 208 | @group | 210 | @group |
| @@ -210,6 +212,11 @@ otherwise. More precisely, this function tests for a list whose | |||
| 210 | @result{} t | 212 | @result{} t |
| 211 | @end group | 213 | @end group |
| 212 | @group | 214 | @group |
| 215 | (fset 'foo '(keymap)) | ||
| 216 | (keymapp 'foo) | ||
| 217 | @result{} t | ||
| 218 | @end group | ||
| 219 | @group | ||
| 213 | (keymapp (current-global-map)) | 220 | (keymapp (current-global-map)) |
| 214 | @result{} t | 221 | @result{} t |
| 215 | @end group | 222 | @end group |