aboutsummaryrefslogtreecommitdiffstats
path: root/src/keymap.c
diff options
context:
space:
mode:
authorStefan Monnier2016-06-15 11:36:51 -0400
committerStefan Monnier2016-06-15 11:36:51 -0400
commit4a2092efd2ac76fce04a2587b360ed2ca1eac4d7 (patch)
treebf5f38017fa292ee4bf17af607d5163831b26d64 /src/keymap.c
parent090060a72c7245796bffeb14daf9da1b49f339f0 (diff)
downloademacs-4a2092efd2ac76fce04a2587b360ed2ca1eac4d7.tar.gz
emacs-4a2092efd2ac76fce04a2587b360ed2ca1eac4d7.zip
Advertize set-keymap-parent as replacement for copy-keymap
* doc/lispref/keymaps.texi (Creating Keymaps): * src/keymap.c (Fcopy_keymap): Advertize set-keymap-parent as replacement.
Diffstat (limited to 'src/keymap.c')
-rw-r--r--src/keymap.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/keymap.c b/src/keymap.c
index 44335aded87..b27df1d0452 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)
971 971
972DEFUN ("copy-keymap", Fcopy_keymap, Scopy_keymap, 1, 1, 0, 972DEFUN ("copy-keymap", Fcopy_keymap, Scopy_keymap, 1, 1, 0,
973 doc: /* Return a copy of the keymap KEYMAP. 973 doc: /* Return a copy of the keymap KEYMAP.
974The copy starts out with the same definitions of KEYMAP, 974
975but changing either the copy or KEYMAP does not affect the other. 975Note that this is almost never needed. If you want a keymap that's like
976another yet with a few changes, you should use map inheritance rather
977than copying. I.e. something like:
978
979 (let ((map (make-sparse-keymap)))
980 (set-keymap-parent map <theirmap>)
981 (define-key map ...)
982 ...)
983
984After performing `copy-keymap', the copy starts out with the same definitions
985of KEYMAP, but changing either the copy or KEYMAP does not affect the other.
976Any key definitions that are subkeymaps are recursively copied. 986Any key definitions that are subkeymaps are recursively copied.
977However, a key definition which is a symbol whose definition is a keymap 987However, a key definition which is a symbol whose definition is a keymap
978is not copied. */) 988is not copied. */)