changeset 29941:0c77254c90b8

(get_keyelt): For menu-items containing a `:filter FILTER', apply FILTER to the menu-item's definition to get the real definition to use.
author Gerd Moellmann <gerd@gnu.org>
date Mon, 26 Jun 2000 15:04:22 +0000
parents 3a3b1bda631d
children 2b775d4b13c3
files src/keymap.c
diffstat 1 files changed, 17 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/keymap.c	Mon Jun 26 15:03:42 2000 +0000
+++ b/src/keymap.c	Mon Jun 26 15:04:22 2000 +0000
@@ -578,15 +578,30 @@
 
       /* 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 */