From: Po Lu Date: Fri, 13 May 2022 08:06:40 +0000 (+0800) Subject: Display help-echo for popup menus on NS X-Git-Tag: emacs-29.0.90~1910^2~742 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=62d2db341ce7b8b109d5f284adac8e19d0a6965e;p=emacs.git Display help-echo for popup menus on NS * src/nsmenu.m ([EmacsMenu menu:willHighlightItem:]): Display help echo for ordinary popup menus as well. --- diff --git a/src/nsmenu.m b/src/nsmenu.m index 34864f94087..9f4825ac140 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -765,17 +765,33 @@ prettify_key (const char *key) NSInteger idx = [item tag]; struct frame *f = SELECTED_FRAME (); Lisp_Object vec = f->menu_bar_vector; - Lisp_Object help, frame; + Lisp_Object help, frame, *client_data; - /* This isn't a menubar, ignore. */ - if (context_menu_value == -1) - return; + XSETFRAME (frame, f); - if (idx >= ASIZE (vec)) - return; + /* This menu isn't a menubar, so use the pointer to the popup menu + data. */ + if (context_menu_value != 0) + { + client_data = (Lisp_Object *) idx; - XSETFRAME (frame, f); - help = AREF (vec, idx + MENU_ITEMS_ITEM_HELP); + if (client_data) + help = client_data[MENU_ITEMS_ITEM_HELP]; + else + help = Qnil; + } + /* Just dismiss any help-echo that might already be in progress if + no menu item will be highlighted. */ + else if (item == nil) + help = Qnil; + else + { + if (idx >= ASIZE (vec)) + return; + + /* Otherwise, get the help data from the menu bar vector. */ + help = AREF (vec, idx + MENU_ITEMS_ITEM_HELP); + } popup_activated_flag++; if (STRINGP (help) || NILP (help))