diff options
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/lispref/keymaps.texi | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi index 61ac80c589c..9abbd898d91 100644 --- a/doc/lispref/keymaps.texi +++ b/doc/lispref/keymaps.texi | |||
| @@ -341,7 +341,21 @@ lots of bindings; for just a few, the sparse keymap is better. | |||
| 341 | @end defun | 341 | @end defun |
| 342 | 342 | ||
| 343 | @defun copy-keymap keymap | 343 | @defun copy-keymap keymap |
| 344 | This function returns a copy of @var{keymap}. Any keymaps that | 344 | This function returns a copy of @var{keymap}. This is almost never |
| 345 | needed. If you want a keymap that's like another yet with a few | ||
| 346 | changes, you should use map inheritance rather than copying. | ||
| 347 | I.e., something like: | ||
| 348 | |||
| 349 | @example | ||
| 350 | @group | ||
| 351 | (let ((map (make-sparse-keymap))) | ||
| 352 | (set-keymap-parent map <theirmap>) | ||
| 353 | (define-key map ...) | ||
| 354 | ...) | ||
| 355 | @end group | ||
| 356 | @end example | ||
| 357 | |||
| 358 | When performing @code{copy-keymap}, any keymaps that | ||
| 345 | appear directly as bindings in @var{keymap} are also copied recursively, | 359 | appear directly as bindings in @var{keymap} are also copied recursively, |
| 346 | and so on to any number of levels. However, recursive copying does not | 360 | and so on to any number of levels. However, recursive copying does not |
| 347 | take place when the definition of a character is a symbol whose function | 361 | take place when the definition of a character is a symbol whose function |