From 3fc720e4bde612fa3943745d06bd2968c123e561 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Mon, 26 Jun 2000 15:05:03 +0000 Subject: [PATCH] (get_keyelt): For menu-items containing a `:filter FILTER', apply FILTER to the menu-item's definition to get the real definition to use. --- src/ChangeLog | 8 +++++++- src/keymap.c | 19 +++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 62777f6b998..842c3652748 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,11 @@ 2000-06-26 Gerd Moellmann + * 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 371b6571c76..11d8ab860a5 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 */ -- 2.39.2