From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Making TTY menus more visual Date: Sat, 03 Oct 2020 11:50:44 +0300 Message-ID: <83wo07g0bf.fsf@gnu.org> References: <087df85a965fac6555a755c1bbebf1ea@finder.org> <83r1qhf5ii.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31501"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Jared Finder Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Oct 03 10:51:38 2020 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 1kOdGS-00085c-T0 for ged-emacs-devel@m.gmane-mx.org; Sat, 03 Oct 2020 10:51:36 +0200 Original-Received: from localhost ([::1]:50772 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kOdGR-0003kT-7R for ged-emacs-devel@m.gmane-mx.org; Sat, 03 Oct 2020 04:51:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58944) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kOdFd-0002sA-AP for emacs-devel@gnu.org; Sat, 03 Oct 2020 04:50:46 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:51806) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kOdFc-0003zN-BX; Sat, 03 Oct 2020 04:50:44 -0400 Original-Received: from [176.228.60.248] (port=1910 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kOdFb-0005e5-Of; Sat, 03 Oct 2020 04:50:44 -0400 In-Reply-To: (message from Jared Finder on Fri, 02 Oct 2020 17:16:55 -0700) 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:256992 Archived-At: > Date: Fri, 02 Oct 2020 17:16:55 -0700 > From: Jared Finder > Cc: emacs-devel@gnu.org > > This is for xterm-mouse support. From what I can tell, > is always bound to tmm-menubar. The following holds on Mac, > Windows, and Linux, and appears to be independent of if you start with > or without --no-window-system: > > ELISP> (lookup-key global-map (kbd " ")) > tmm-menubar-mouse That is true, but when mouse clicks on the menu bar are supported, this binding is never used. However, maybe this is not so for xterm-mouse. > This addition is for TTY menus triggered via xterm-mouse-mode. If this > makes sense to add as a feature, I can finish up my patches. Yes, having the TTY drop-down menus supported with xterm-mouse is something we would welcome very much. > I see the following things that need to change: > > 1. Add a new command that calls menu-bar-open with the right value for > initial-x. (this is the patch 001 in the root of the thread) But patch 001 also includes unrelated parts, the tmm-menubar-item-at-x function etc., right? > 2. In read_menu_input in term.c, additional logic needs to be added to > handle xterm mouse clicks since the focused menu item will not be > necessarily the one clicked on. I'm not sure I understand how this can happen. Can you describe the sequence of events that could lead to this, assuming tmm-menubar is NOT involved? When TTY menus drop down from the menu bar, the focused item and the one clicked on should always coincide. Any click on another item is a click "outside of the popped up menu", and that should dismiss the menu. > Also, a user may click outside of the popped up menu, which they > would expect to dismiss the menu. (this is patch 002 in the root of > the thread, not yet complete) This should already work; it does in the MS-Windows build when Emacs is invoked with -nw. Please tell more why you think any changes there are needed. Perhaps you could take me through the code there and explain what is missing and why. (And why do you call posn-x-y in the patch when X and Y are already known and used by that code? is that because mouse_get_xy does not yet support xterm-mouse? if so, that support should be added via the terminal's mouse_position_hook.) > 3. The new command should replace the current binding of > . Yes, eventually this should be done as part of turning on xterm-mouse-mode. Thanks.