From 6214507352b68ebae83a29589fdb66311fbe691d Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Fri, 21 Jul 2000 14:35:53 +0000 Subject: [PATCH] (menu_help_callback): Call show_help_echo with additional arguments OBJECT and POS. --- src/ChangeLog | 22 ++++++++++++++++++++++ src/xmenu.c | 36 ++++++++++++++++++++++++++++++------ 2 files changed, 52 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index d28a76cdc2f..f6a18b1622d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,25 @@ +2000-07-21 Gerd Moellmann + + * 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 + + * xmenu.c (menu_help_callback): Call show_help_echo with + additional arguments OBJECT and POS. + 2000-07-21 Kenichi Handa * data.c (Faset): Allow storing any multibyte character in a diff --git a/src/xmenu.c b/src/xmenu.c index f18250ca256..e341336214a 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -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) -- 2.39.2