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.devel Subject: Re: New Context Menu Date: Fri, 20 Aug 2021 10:24:00 +0300 Organization: LINKOV.NET Message-ID: <87eeaoio3v.fsf@mail.linkov.net> References: <20210818120834.i3orh535tb2enpos.ref@Ergus> <20210818120834.i3orh535tb2enpos@Ergus> <87r1epzznt.fsf@mail.linkov.net> <20210819135701.ygypxl7asl4edwbp@Ergus> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39265"; 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: emacs-devel@gnu.org To: Ergus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Aug 20 09:35:27 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mGz3m-0009z2-UG for ged-emacs-devel@m.gmane-mx.org; Fri, 20 Aug 2021 09:35:26 +0200 Original-Received: from localhost ([::1]:47118 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mGz3l-0006S9-4P for ged-emacs-devel@m.gmane-mx.org; Fri, 20 Aug 2021 03:35:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mGz1D-0001PF-Ci for emacs-devel@gnu.org; Fri, 20 Aug 2021 03:32:47 -0400 Original-Received: from relay1-d.mail.gandi.net ([217.70.183.193]:23719) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mGz19-0004h8-M8 for emacs-devel@gnu.org; Fri, 20 Aug 2021 03:32:47 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id ADC4B24000F; Fri, 20 Aug 2021 07:32:40 +0000 (UTC) In-Reply-To: <20210819135701.ygypxl7asl4edwbp@Ergus> (Ergus's message of "Thu, 19 Aug 2021 15:57:01 +0200") Received-SPF: pass client-ip=217.70.183.193; envelope-from=juri@linkov.net; helo=relay1-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:272701 Archived-At: >>1. one click: down-mouse-1, select a menu item, release mouse-1; >>2. two clicks: click mouse-1, select a menu item by clicking mouse-1 again. >> >>Both ways work on xterm as well - you can easily select a menu item with >>one click on xterm too. > > For me only 1. works now as you describe on xterm. > > Whenever I try 2. it doesn't work the menu disappears when I release the > button either fast or slow. With the problem that releasing fast usually > selects the first item (generally Undo). Do other menus work for you? What do you see when clicking C- bound to mouse-buffer-menu, or S- bound to mouse-appearance-menu, or C- bound to mouse-menu-bar-map, etc. > There is the menu key that nobody seems to use because since 2007 nobody > noticed that it is not bound for xterm. Everywhere else (browsers, > editors, explorers) the menu key has the same effect than right click, > so if we want a binding, this is the right one. Sadly > execute-extended-command is bound to [menu]; but the user may know that > when context-menu is enabled, that binding is replaced for something > standard... (or add a custom to set it). Does this patch work for you? If yes, then we could create context-menu-mode-map active for context-menu-mode and add these keybindings to it. diff --git a/lisp/mouse.el b/lisp/mouse.el index d2a5200d8d..ecf95f11b5 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -454,8 +455,13 @@ context-menu-mode (setq context-menu--old-mouse-3 (global-key-binding [mouse-3])) (global-unset-key [mouse-3]) (setq context-menu--old-down-mouse-3 (global-key-binding [down-mouse-3])) - (global-set-key [down-mouse-3] context-menu-entry)) + (global-set-key [down-mouse-3] context-menu-entry) + (setq context-menu--old-menu (global-key-binding [menu])) + (global-set-key [menu] context-menu-entry)) (t + (when context-menu--old-menu + (global-set-key [menu] context-menu--old-menu) + (setq context-menu--old-menu nil)) (if (not context-menu--old-down-mouse-3) (global-unset-key [down-mouse-3]) (global-set-key [down-mouse-3] context-menu--old-down-mouse-3)