aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann <[email protected]>2000-06-26 15:05:03 +0000
committerGerd Moellmann <[email protected]>2000-06-26 15:05:03 +0000
commit3fc720e4bde612fa3943745d06bd2968c123e561 (patch)
tree995e693e4cbf85e0b681f21f5fa7959d5c2ed724 /src
parent1425dcb619137a3cbd8393fd0db0fba1a5e0b059 (diff)
(get_keyelt): For menu-items containing a `:filter
FILTER', apply FILTER to the menu-item's definition to get the real definition to use.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog8
-rw-r--r--src/keymap.c19
2 files changed, 24 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 62777f6b99..842c365274 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,11 @@
2000-06-26 Gerd Moellmann <[email protected]>
+ * keymap.c (get_keyelt): For menu-items containing a `:filter
+ FILTER', apply FILTER to the menu-item's definition to get the
+ real definition to use.
+
+ * lisp.h (QCfilter): External declaration.
+
* xfns.c (Fimage_size): New function.
(syms_of_xfns): Defsubr it.
@@ -54,7 +60,7 @@
include time.h, done by systime.h.
[__FreeBSD__]: Remove redundant includes.
- * callproc.c: (setpgrp): Undefine before defining.
+ * callproc.c (setpgrp): Undefine before defining.
(delete_temp_file): Return Qnil to avoid warning.
* config.in (HAVE_TERM_H, HAVE_STRUCT_TIMEZONE): Add.
diff --git a/src/keymap.c b/src/keymap.c
index 371b6571c7..11d8ab860a 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -578,15 +578,30 @@ get_keyelt (object, autoload)
/* If the keymap contents looks like (menu-item name . DEFN)
or (menu-item name DEFN ...) then use DEFN.
- This is a new format menu item.
- */
+ This is a new format menu item. */
else if (EQ (XCAR (object), Qmenu_item))
{
if (CONSP (XCDR (object)))
{
+ Lisp_Object tem;
+
object = XCDR (XCDR (object));
+ tem = object;
if (CONSP (object))
object = XCAR (object);
+
+ /* If there's a `:filter FILTER', apply FILTER to the
+ menu-item's definition to get the real definition to
+ use. */
+ for (; CONSP (tem) && CONSP (XCDR (tem)); tem = XCDR (tem))
+ if (EQ (XCAR (tem), QCfilter))
+ {
+ Lisp_Object filter;
+ filter = XCAR (XCDR (tem));
+ filter = list2 (filter, list2 (Qquote, object));
+ object = menu_item_eval_property (filter);
+ break;
+ }
}
else
/* Invalid keymap */