aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2021-08-22 11:44:55 +0300
committerJuri Linkov2021-08-22 11:46:08 +0300
commitdd7d966eb40b58a221ea29930582b8173ea87ee2 (patch)
tree4cbe3d05f0f2d471e2c2d824825935158417b1a1
parent654e096b09378b2b0d1cdc9b8c0634bf5f3c9306 (diff)
downloademacs-dd7d966eb40b58a221ea29930582b8173ea87ee2.tar.gz
emacs-dd7d966eb40b58a221ea29930582b8173ea87ee2.zip
Don't show menu titles with the text property 'hide' (bug#50067)
* lisp/mouse.el (context-menu-map): Add menu title "Context Menu" propertized with the text property 'hide'. * src/menu.c (x_popup_menu_1): Don't show the title with the non-nil text property 'hide' on GTK and NS.
-rw-r--r--lisp/mouse.el2
-rw-r--r--src/menu.c8
2 files changed, 9 insertions, 1 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 3441a4787e6..7cdea34d865 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -304,7 +304,7 @@ the same menu with changes such as added new menu items."
304 304
305(defun context-menu-map () 305(defun context-menu-map ()
306 "Return composite menu map." 306 "Return composite menu map."
307 (let ((menu (make-sparse-keymap))) 307 (let ((menu (make-sparse-keymap (propertize "Context Menu" 'hide t))))
308 (run-hook-wrapped 'context-menu-functions 308 (run-hook-wrapped 'context-menu-functions
309 (lambda (fun) 309 (lambda (fun)
310 (setq menu (funcall fun menu)) 310 (setq menu (funcall fun menu))
diff --git a/src/menu.c b/src/menu.c
index e441d22ea04..4edd4ce33f9 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -1284,6 +1284,14 @@ x_popup_menu_1 (Lisp_Object position, Lisp_Object menu)
1284 /* Search for a string appearing directly as an element of the keymap. 1284 /* Search for a string appearing directly as an element of the keymap.
1285 That string is the title of the menu. */ 1285 That string is the title of the menu. */
1286 prompt = Fkeymap_prompt (keymap); 1286 prompt = Fkeymap_prompt (keymap);
1287
1288#if defined (USE_GTK) || defined (HAVE_NS)
1289 if (STRINGP (prompt)
1290 && SCHARS (prompt) > 0
1291 && !NILP (Fget_text_property (make_fixnum (0), Qhide, prompt)))
1292 title = Qnil;
1293 else
1294#endif
1287 if (!NILP (prompt)) 1295 if (!NILP (prompt))
1288 title = prompt; 1296 title = prompt;
1289 1297