emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 599aea3012 1/4: * src/keymap.c (Fcopy_keymap): Document using def


From: Stefan Kangas
Subject: master 599aea3012 1/4: * src/keymap.c (Fcopy_keymap): Document using defvar-keymap.
Date: Mon, 4 Jul 2022 11:02:15 -0400 (EDT)

branch: master
commit 599aea301283327a00e57a95c47148d28e93f1fc
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    * src/keymap.c (Fcopy_keymap): Document using defvar-keymap.
---
 src/keymap.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/keymap.c b/src/keymap.c
index 2b77a7fc44..506b755e5d 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1026,8 +1026,14 @@ DEFUN ("copy-keymap", Fcopy_keymap, Scopy_keymap, 1, 1, 
0,
        doc: /* Return a copy of the keymap KEYMAP.
 
 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:
+another yet with a few changes, you should use keymap inheritance rather
+than copying.  That is, something like:
+
+    (defvar-keymap foo-map
+      :parent <theirmap>
+      ...)
+
+Or, if you need to support Emacs versions older than 29:
 
     (let ((map (make-sparse-keymap)))
       (set-keymap-parent map <theirmap>)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]