(menu_help_callback): Call show_help_echo with
authorGerd Moellmann <gerd@gnu.org>
Fri, 21 Jul 2000 14:35:53 +0000 (14:35 +0000)
committerGerd Moellmann <gerd@gnu.org>
Fri, 21 Jul 2000 14:35:53 +0000 (14:35 +0000)
additional arguments OBJECT and POS.

src/ChangeLog
src/xmenu.c

index d28a76c..f6a18b1 100644 (file)
@@ -1,3 +1,25 @@
+2000-07-21  Gerd Moellmann  <gerd@gnu.org>
+
+       * window.c (foreach_window): Instead of a fake variable argument
+       list, take one USER_DATA argument.
+       (foreach_window_1): Likewise, and call callback functions with two
+       args, the window and USER_DATA.
+       (struct check_window_data): New struct.
+       (check_window_containing): Use it.
+       (window_from_coordinates): Set up a struct check_window_data for
+       foreach_window.
+       (add_window_to_list, freeze_window_start): Change parameters
+       according to new calling convention.
+
+       * window.h (foreach_window): Change prototype.
+
+       * buffer.c (Fprevious_overlay_change): Avoid memory leak.
+
+2000-07-21  Eli Zaretskii  <eliz@is.elta.co.il>
+
+       * xmenu.c (menu_help_callback): Call show_help_echo with
+       additional arguments OBJECT and POS.
+
 2000-07-21  Kenichi Handa  <handa@etl.go.jp>
 
        * data.c (Faset): Allow storing any multibyte character in a
index f18250c..e341336 100644 (file)
@@ -2482,18 +2482,42 @@ xdialog_show (f, keymaps, title, error)
 static struct frame *menu_help_frame;
 
 
-/* Show help HELP_STRING, or clear help if HELP_STRING is null.  This
-   cannot be done with generating a HELP_EVENT because XMenuActivate
-   contains a loop that doesn't let Emacs process keyboard events.  */
+/* Show help HELP_STRING, or clear help if HELP_STRING is null.
+
+   PANE is the pane number, and ITEM is the menu item number in
+   the menu (currently not used).
+   
+   This cannot be done with generating a HELP_EVENT because
+   XMenuActivate contains a loop that doesn't let Emacs process
+   keyboard events.  */
 
 static void
-menu_help_callback (help_string)
+menu_help_callback (help_string, pane, item)
      char *help_string;
+     int pane, item;
 {
+  extern Lisp_Object Qmenu_item;
+  Lisp_Object *first_item;
+  Lisp_Object pane_name;
+  Lisp_Object menu_object;
+  first_item = XVECTOR (menu_items)->contents;
+  if (EQ (first_item[0], Qt))
+    pane_name = first_item[MENU_ITEMS_PANE_NAME];
+  else if (EQ (first_item[0], Qquote))
+    /* This shouldn't happen, see xmenu_show.  */
+    pane_name = build_string ("");
+  else
+    pane_name = first_item[MENU_ITEMS_ITEM_NAME];
+  /* (menu-item MENU-NAME PANE-NUMBER)  */
+  menu_object = Fcons (Qmenu_item,
+                      Fcons (pane_name,
+                             Fcons (make_number (pane), Qnil)));
   show_help_echo (help_string ? build_string (help_string) : Qnil,
-                 Qnil, Qnil, 0, 1);
+                 Qnil, menu_object, make_number (item), 1);
 }
-
+  
 
 static Lisp_Object
 xmenu_show (f, x, y, for_click, keymaps, title, error)