aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Kangas2022-07-04 16:02:26 +0200
committerStefan Kangas2022-07-04 17:01:53 +0200
commit599aea301283327a00e57a95c47148d28e93f1fc (patch)
treeefad320f03be16da70d88f6bf61bfa102c34a612 /src
parentcfc754a67c049e9297c19eb5400f8ea38159a0d9 (diff)
downloademacs-599aea301283327a00e57a95c47148d28e93f1fc.tar.gz
emacs-599aea301283327a00e57a95c47148d28e93f1fc.zip
* src/keymap.c (Fcopy_keymap): Document using defvar-keymap.
Diffstat (limited to 'src')
-rw-r--r--src/keymap.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/keymap.c b/src/keymap.c
index 2b77a7fc444..506b755e5da 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1026,8 +1026,14 @@ DEFUN ("copy-keymap", Fcopy_keymap, Scopy_keymap, 1, 1, 0,
1026 doc: /* Return a copy of the keymap KEYMAP. 1026 doc: /* Return a copy of the keymap KEYMAP.
1027 1027
1028Note that this is almost never needed. If you want a keymap that's like 1028Note that this is almost never needed. If you want a keymap that's like
1029another yet with a few changes, you should use map inheritance rather 1029another yet with a few changes, you should use keymap inheritance rather
1030than copying. I.e. something like: 1030than copying. That is, something like:
1031
1032 (defvar-keymap foo-map
1033 :parent <theirmap>
1034 ...)
1035
1036Or, if you need to support Emacs versions older than 29:
1031 1037
1032 (let ((map (make-sparse-keymap))) 1038 (let ((map (make-sparse-keymap)))
1033 (set-keymap-parent map <theirmap>) 1039 (set-keymap-parent map <theirmap>)