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: Thu, 19 Aug 2021 10:01:10 +0300 Organization: LINKOV.NET Message-ID: <87r1epzznt.fsf@mail.linkov.net> References: <20210818120834.i3orh535tb2enpos.ref@Ergus> <20210818120834.i3orh535tb2enpos@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="40544"; 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 Thu Aug 19 09:22:41 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 1mGcNt-000AOj-OM for ged-emacs-devel@m.gmane-mx.org; Thu, 19 Aug 2021 09:22:41 +0200 Original-Received: from localhost ([::1]:54388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mGcNs-0008JH-KK for ged-emacs-devel@m.gmane-mx.org; Thu, 19 Aug 2021 03:22:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mGcN2-0006TD-4t for emacs-devel@gnu.org; Thu, 19 Aug 2021 03:21:49 -0400 Original-Received: from relay12.mail.gandi.net ([217.70.178.232]:40003) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mGcN0-0001T4-0G for emacs-devel@gnu.org; Thu, 19 Aug 2021 03:21:47 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 1718B200004; Thu, 19 Aug 2021 07:21:41 +0000 (UTC) In-Reply-To: <20210818120834.i3orh535tb2enpos@Ergus> (Ergus's message of "Wed, 18 Aug 2021 14:08:34 +0200") Received-SPF: pass client-ip=217.70.178.232; envelope-from=juri@linkov.net; helo=relay12.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_H2=-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:272643 Archived-At: > The current implementation follows the X11 menu interaction pattern: > Hold mouse-3 to keep the menu active and release mouse-3 to select an > entry. > > Could we add an option to avoid this and have the same interaction > behavior than in gui please?: mouse-3 activates the menu, a click over > an option selects it and a click outside the menu hides the menu When you press down-mouse-1 and immediately release the mouse button, it has the same effect as if you clicked mouse-1: it displays the menu without selecting a menu item. So with the current win-win situation both scenarios are supported: 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. > In case the user wants to bind the context menu without using the mouse > how can be done? Will the context-menu appear in the current cursor > (point) or in the current mouse arrow position? This is possible, but the menu appears at the left top corner, as for example it appears on typing 'C-' that runs the command buffer-menu-open. Here is its implementation: (defun buffer-menu-open () "Start key navigation of the buffer menu. This is the keyboard interface to \\[mouse-buffer-menu]." (interactive) (popup-menu (mouse-buffer-menu-keymap) (posn-at-x-y 0 0 nil t))) We could do the same with: (popup-menu (context-menu-map) (posn-at-x-y 0 0 nil t)) Or do it much better: (popup-menu (context-menu-map) (point)) What would a good key to bind such command? Maybe 'S-'? But please note that currently when you select a menu item using the keyboard, many commands will fail with (error "Command must be bound to an event with parameters")