]> git.eshelyaron.com Git - emacs.git/commitdiff
(menu_bar_one_keymap): If KEYMAP is a symbol,
authorGerd Moellmann <gerd@gnu.org>
Fri, 29 Sep 2000 12:42:01 +0000 (12:42 +0000)
committerGerd Moellmann <gerd@gnu.org>
Fri, 29 Sep 2000 12:42:01 +0000 (12:42 +0000)
use its function definition.
(tool_bar_items): Likewise.

src/ChangeLog
src/keyboard.c

index e0a9721c5e4b1aec6ff4f56bf155c901ca1a09f3..01ccd9ce9f915b007774cb9519b1b741922f496b 100644 (file)
@@ -1,5 +1,9 @@
 2000-09-29  Gerd Moellmann  <gerd@gnu.org>
 
+       * keyboard.c (menu_bar_one_keymap): If KEYMAP is a symbol,
+       use its function definition.
+       (tool_bar_items): Likewise.
+
        * lisp.h (fatal): Declare NO_RETURN.
        
 2000-09-29  Kenichi Handa  <handa@etl.go.jp>
index 8199667bf07b8e103a78c38f2b4e91fbdce698ea..501174faaca45a098e8ccdec4e6e93f0943e1552 100644 (file)
@@ -6139,8 +6139,8 @@ map_prompt (map)
   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 @@ menu_bar_items (old)
   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 @@ menu_bar_one_keymap (keymap)
 {
   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 @@ tool_bar_items (reuse, nitems)
          {
            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))
              {