aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Ingebrigtsen2021-10-11 13:15:41 +0200
committerLars Ingebrigtsen2021-10-11 13:15:41 +0200
commit74d3a1e7d6450f226d2f942d0c0e3410eea87dfc (patch)
tree8335d6fac9fcf3c85d41d15fd98e68aee814d473 /src
parent85b8609f9572eb4d9d6d6f856097090513051ab5 (diff)
downloademacs-74d3a1e7d6450f226d2f942d0c0e3410eea87dfc.tar.gz
emacs-74d3a1e7d6450f226d2f942d0c0e3410eea87dfc.zip
Allow :keys in menus to be computed dynamically
* doc/lispref/keymaps.texi (Extended Menu Items): Document it (bug#28930). * src/keyboard.c (parse_menu_item): Allow :keys to be a function.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 9a50a5e5eb7..7184b1509b1 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -7841,7 +7841,9 @@ parse_menu_item (Lisp_Object item, int inmenubar)
7841 else if (EQ (tem, QCkeys)) 7841 else if (EQ (tem, QCkeys))
7842 { 7842 {
7843 tem = XCAR (item); 7843 tem = XCAR (item);
7844 if (CONSP (tem) || STRINGP (tem)) 7844 if (FUNCTIONP (tem))
7845 ASET (item_properties, ITEM_PROPERTY_KEYEQ, call0 (tem));
7846 else if (CONSP (tem) || STRINGP (tem))
7845 ASET (item_properties, ITEM_PROPERTY_KEYEQ, tem); 7847 ASET (item_properties, ITEM_PROPERTY_KEYEQ, tem);
7846 } 7848 }
7847 else if (EQ (tem, QCbutton) && CONSP (XCAR (item))) 7849 else if (EQ (tem, QCbutton) && CONSP (XCAR (item)))