X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/25cc0f2aada3e321e5f1c6d1e492a93d16da45b2..9569916d94c6c448862d02919e52fc3bfb9b9c8d:/src/keymap.c diff --git a/src/keymap.c b/src/keymap.c index 44335aded8..b27df1d045 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -971,8 +971,18 @@ copy_keymap_1 (Lisp_Object chartable, Lisp_Object idx, Lisp_Object elt) DEFUN ("copy-keymap", Fcopy_keymap, Scopy_keymap, 1, 1, 0, doc: /* Return a copy of the keymap KEYMAP. -The copy starts out with the same definitions of KEYMAP, -but changing either the copy or KEYMAP does not affect the other. + +Note that this is almost never needed. If you want a keymap that's like +another yet with a few changes, you should use map inheritance rather +than copying. I.e. something like: + + (let ((map (make-sparse-keymap))) + (set-keymap-parent map ) + (define-key map ...) + ...) + +After performing `copy-keymap', the copy starts out with the same definitions +of KEYMAP, but changing either the copy or KEYMAP does not affect the other. Any key definitions that are subkeymaps are recursively copied. However, a key definition which is a symbol whose definition is a keymap is not copied. */)