aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2000-06-26 15:05:03 +0000
committerGerd Moellmann2000-06-26 15:05:03 +0000
commit3fc720e4bde612fa3943745d06bd2968c123e561 (patch)
tree995e693e4cbf85e0b681f21f5fa7959d5c2ed724
parent1425dcb619137a3cbd8393fd0db0fba1a5e0b059 (diff)
downloademacs-3fc720e4bde612fa3943745d06bd2968c123e561.tar.gz
emacs-3fc720e4bde612fa3943745d06bd2968c123e561.zip
(get_keyelt): For menu-items containing a `:filter
FILTER', apply FILTER to the menu-item's definition to get the real definition to use.
-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 62777f6b998..842c3652748 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,11 @@
12000-06-26 Gerd Moellmann <gerd@gnu.org> 12000-06-26 Gerd Moellmann <gerd@gnu.org>
2 2
3 * keymap.c (get_keyelt): For menu-items containing a `:filter
4 FILTER', apply FILTER to the menu-item's definition to get the
5 real definition to use.
6
7 * lisp.h (QCfilter): External declaration.
8
3 * xfns.c (Fimage_size): New function. 9 * xfns.c (Fimage_size): New function.
4 (syms_of_xfns): Defsubr it. 10 (syms_of_xfns): Defsubr it.
5 11
@@ -54,7 +60,7 @@
54 include time.h, done by systime.h. 60 include time.h, done by systime.h.
55 [__FreeBSD__]: Remove redundant includes. 61 [__FreeBSD__]: Remove redundant includes.
56 62
57 * callproc.c: (setpgrp): Undefine before defining. 63 * callproc.c (setpgrp): Undefine before defining.
58 (delete_temp_file): Return Qnil to avoid warning. 64 (delete_temp_file): Return Qnil to avoid warning.
59 65
60 * config.in (HAVE_TERM_H, HAVE_STRUCT_TIMEZONE): Add. 66 * 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)
578 578
579 /* If the keymap contents looks like (menu-item name . DEFN) 579 /* If the keymap contents looks like (menu-item name . DEFN)
580 or (menu-item name DEFN ...) then use DEFN. 580 or (menu-item name DEFN ...) then use DEFN.
581 This is a new format menu item. 581 This is a new format menu item. */
582 */
583 else if (EQ (XCAR (object), Qmenu_item)) 582 else if (EQ (XCAR (object), Qmenu_item))
584 { 583 {
585 if (CONSP (XCDR (object))) 584 if (CONSP (XCDR (object)))
586 { 585 {
586 Lisp_Object tem;
587
587 object = XCDR (XCDR (object)); 588 object = XCDR (XCDR (object));
589 tem = object;
588 if (CONSP (object)) 590 if (CONSP (object))
589 object = XCAR (object); 591 object = XCAR (object);
592
593 /* If there's a `:filter FILTER', apply FILTER to the
594 menu-item's definition to get the real definition to
595 use. */
596 for (; CONSP (tem) && CONSP (XCDR (tem)); tem = XCDR (tem))
597 if (EQ (XCAR (tem), QCfilter))
598 {
599 Lisp_Object filter;
600 filter = XCAR (XCDR (tem));
601 filter = list2 (filter, list2 (Qquote, object));
602 object = menu_item_eval_property (filter);
603 break;
604 }
590 } 605 }
591 else 606 else
592 /* Invalid keymap */ 607 /* Invalid keymap */