summaryrefslogtreecommitdiff
path: root/src/menu.c
diff options
context:
space:
mode:
authorYuuki Harano <masm+github@masm11.me>2021-11-11 00:39:53 +0900
committerYuuki Harano <masm+github@masm11.me>2021-11-11 00:39:53 +0900
commit4dd1f56f29fc598a8339a345c2f8945250600602 (patch)
treeaf341efedffe027e533b1bcc0dbf270532e48285 /src/menu.c
parent4c49ec7f865bdad1629d2f125f71f4e506b258f2 (diff)
parent810fa21d26453f898de9747ece7205dfe6de9d08 (diff)
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs into feature/pgtk
Diffstat (limited to 'src/menu.c')
-rw-r--r--src/menu.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/menu.c b/src/menu.c
index a2738ebd8a2..780b71eba6b 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -1127,9 +1127,12 @@ x_popup_menu_1 (Lisp_Object position, Lisp_Object menu)
/* Decode the first argument: find the window and the coordinates. */
if (EQ (position, Qt)
- || (CONSP (position) && (EQ (XCAR (position), Qmenu_bar)
- || EQ (XCAR (position), Qtab_bar)
- || EQ (XCAR (position), Qtool_bar))))
+ || (CONSP (position)
+ && (EQ (XCAR (position), Qmenu_bar)
+ || EQ (XCAR (position), Qtab_bar)
+ || (CONSP (XCDR (position))
+ && EQ (XCAR (XCDR (position)), Qtab_bar))
+ || EQ (XCAR (position), Qtool_bar))))
{
get_current_pos_p = 1;
}
@@ -1284,12 +1287,16 @@ x_popup_menu_1 (Lisp_Object position, Lisp_Object menu)
/* Search for a string appearing directly as an element of the keymap.
That string is the title of the menu. */
prompt = Fkeymap_prompt (keymap);
- if (!NILP (prompt))
- title = prompt;
-#ifdef HAVE_NS /* Is that needed and NS-specific? --Stef */
+
+#if defined (USE_GTK) || defined (HAVE_NS)
+ if (STRINGP (prompt)
+ && SCHARS (prompt) > 0
+ && !NILP (Fget_text_property (make_fixnum (0), Qhide, prompt)))
+ title = Qnil;
else
- title = build_string ("Select");
#endif
+ if (!NILP (prompt))
+ title = prompt;
/* Make that be the pane title of the first pane. */
if (!NILP (prompt) && menu_items_n_panes >= 0)
@@ -1575,6 +1582,8 @@ syms_of_menu (void)
menu_items = Qnil;
staticpro (&menu_items);
+ DEFSYM (Qhide, "hide");
+
defsubr (&Sx_popup_menu);
defsubr (&Sx_popup_dialog);
defsubr (&Smenu_bar_menu_at_x_y);