From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#50067: Context menus Date: Fri, 20 Aug 2021 19:36:58 +0300 Organization: LINKOV.NET Message-ID: <87mtpcf79p.fsf@mail.linkov.net> References: <74BC00E9-2509-47DA-9428-1523FF7F3B33@acm.org> <87v942pvcj.fsf@mail.linkov.net> <83zgte3asy.fsf@gnu.org> <87mtpepqzw.fsf@mail.linkov.net> <83sfz639lh.fsf@gnu.org> <8735r6ppf0.fsf@mail.linkov.net> <83o89u37gh.fsf@gnu.org> <87wnohx5zd.fsf@mail.linkov.net> <831r6p3lzc.fsf@gnu.org> <87o89sh96g.fsf@mail.linkov.net> <837dgg1hdg.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17195"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: alan@idiocy.org, mattiase@acm.org, homeros.misasa@gmail.com, tkk@misasa.okayama-u.ac.jp, larsi@gnus.org, 50067@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 20 18:53:48 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mH7m8-0004E1-4e for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 20 Aug 2021 18:53:48 +0200 Original-Received: from localhost ([::1]:48760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mH7m7-0007q7-3L for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 20 Aug 2021 12:53:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39106) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mH7lO-0006EL-AT for bug-gnu-emacs@gnu.org; Fri, 20 Aug 2021 12:53:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52144) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mH7lO-0003JG-0y for bug-gnu-emacs@gnu.org; Fri, 20 Aug 2021 12:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mH7lO-0001C5-02 for bug-gnu-emacs@gnu.org; Fri, 20 Aug 2021 12:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Aug 2021 16:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50067 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 50067-submit@debbugs.gnu.org id=B50067.16294783374492 (code B ref 50067); Fri, 20 Aug 2021 16:53:01 +0000 Original-Received: (at 50067) by debbugs.gnu.org; 20 Aug 2021 16:52:17 +0000 Original-Received: from localhost ([127.0.0.1]:35446 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mH7kY-0001AH-79 for submit@debbugs.gnu.org; Fri, 20 Aug 2021 12:52:17 -0400 Original-Received: from relay1-d.mail.gandi.net ([217.70.183.193]:11087) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mH7kW-0001A1-Qv for 50067@debbugs.gnu.org; Fri, 20 Aug 2021 12:52:09 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id A4B3D240006; Fri, 20 Aug 2021 16:51:58 +0000 (UTC) In-Reply-To: <837dgg1hdg.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 20 Aug 2021 14:32:27 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:212297 Archived-At: --=-=-= Content-Type: text/plain >> An example of such menu is mouse-buffer-menu bound to C- >> where the user might wonder what do these menu items with mode names mean? > > OK, but I still don't think I fully understand how context menus are > different. Are we sure the user will immediately understand the > purpose of the context menus, but not of a buffer-menu? Context menus displayed up by down-mouse-3 are ubiquitous nowadays, they are everywhere, and the users expect them without a title, unlike Emacs-specific menus unfamiliar to most users. >> Using a text property would be a good solution. Should then >> the NS-specific "Select" title be removed in menu.c >> when the title has a special text property? > > I'm not sure I understand what is the NS-specific "Select" title. Can > you point me to the relevant code? I meant such patch: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=context-menu-title.patch diff --git a/lisp/mouse.el b/lisp/mouse.el index d2a5200d8d..f9355b4f73 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -304,7 +304,7 @@ context-menu-filter-function (defun context-menu-map () "Return composite menu map." - (let ((menu (make-sparse-keymap))) + (let ((menu (make-sparse-keymap (propertize "Context Menu" 'hide t)))) (run-hook-wrapped 'context-menu-functions (lambda (fun) (setq menu (funcall fun menu)) diff --git a/src/menu.c b/src/menu.c index 3b1d740257..6654c47c93 100644 --- a/src/menu.c +++ b/src/menu.c @@ -1284,6 +1284,14 @@ 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 defined (USE_GTK) || defined (HAVE_NS) + if (STRINGP (prompt) + && SCHARS (prompt) > 0 + && !NILP (Fget_text_property (make_fixnum (0), Qhide, prompt))) + title = Qnil; + else +#endif if (!NILP (prompt)) title = prompt; #ifdef HAVE_NS /* Is that needed and NS-specific? --Stef */ --=-=-=--