changeset 31995:6a45a15137b0

(menu_bar_one_keymap): If KEYMAP is a symbol, use its function definition. (tool_bar_items): Likewise.
author Gerd Moellmann <gerd@gnu.org>
date Fri, 29 Sep 2000 12:41:40 +0000
parents baf314674954
children ea0299ebce0e
files src/keyboard.c
diffstat 1 files changed, 18 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/keyboard.c	Fri Sep 29 09:32:42 2000 +0000
+++ b/src/keyboard.c	Fri Sep 29 12:41:40 2000 +0000
@@ -6139,8 +6139,8 @@
   return Qnil;
 }
 
-static void menu_bar_item ();
-static void menu_bar_one_keymap ();
+static void menu_bar_item P_ ((Lisp_Object, Lisp_Object));
+static void menu_bar_one_keymap P_ ((Lisp_Object));
 
 /* These variables hold the vector under construction within
    menu_bar_items and its subroutines, and the current index
@@ -6236,16 +6236,13 @@
   result = Qnil;
 
   for (mapno = nmaps - 1; mapno >= 0; mapno--)
-    {
-      if (! NILP (maps[mapno]))
+    if (!NILP (maps[mapno]))
+      {
 	def = get_keyelt (access_keymap (maps[mapno], Qmenu_bar, 1, 0), 0);
-      else
-	def = Qnil;
-
-      tem = Fkeymapp (def);
-      if (!NILP (tem))
-	menu_bar_one_keymap (def);
-    }
+	tem = Fkeymapp (def);
+	if (!NILP (tem))
+	  menu_bar_one_keymap (def);
+      }
 
   /* Move to the end those items that should be at the end.  */
 
@@ -6309,6 +6306,11 @@
 {
   Lisp_Object tail, item;
 
+  /* If KEYMAP is a symbol, its function definition is the keymap
+     to use.  */
+  if (SYMBOLP (keymap))
+    keymap = indirect_function (keymap);
+
   menu_bar_one_keymap_changed_items = Qnil;
 
   /* Loop over all keymap entries that have menu strings.  */
@@ -6901,6 +6903,11 @@
 	  {
 	    Lisp_Object tail;
 	    
+	    /* If KEYMAP is a symbol, its function definition is the
+	       keymap to use.  */
+	    if (SYMBOLP (keymap))
+	      keymap = indirect_function (keymap);
+
 	    /* KEYMAP is a list `(keymap (KEY . BINDING) ...)'.  */
 	    for (tail = keymap; CONSP (tail); tail = XCDR (tail))
 	      {