From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jared Finder via "Emacs development discussions." Newsgroups: gmane.emacs.devel Subject: Re: Making TTY menus more visual Date: Sat, 03 Oct 2020 16:25:42 -0700 Message-ID: <0bef298d6a043483afdcea119a330bb9@finder.org> References: <087df85a965fac6555a755c1bbebf1ea@finder.org> <83r1qhf5ii.fsf@gnu.org> <83wo07g0bf.fsf@gnu.org> <85afa5c0a0a789c6047e92f6ecfa9fcc@finder.org> <72bbff31bcf46be917c9e8d8236cad75@finder.org> Reply-To: Jared Finder Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7189"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Roundcube Webmail/1.3.15 Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Oct 04 01:26:47 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 1kOqvP-0001jO-Qq for ged-emacs-devel@m.gmane-mx.org; Sun, 04 Oct 2020 01:26:47 +0200 Original-Received: from localhost ([::1]:53514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kOqvO-0007FJ-Pz for ged-emacs-devel@m.gmane-mx.org; Sat, 03 Oct 2020 19:26:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kOquQ-0006np-H2 for emacs-devel@gnu.org; Sat, 03 Oct 2020 19:25:46 -0400 Original-Received: from greenhill.hpalace.com ([2600:3c01::f03c:91ff:fe73:2daa]:55698) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kOquO-0002pD-Lz; Sat, 03 Oct 2020 19:25:46 -0400 Original-Received: from mail.finder.org (greenhill.hpalace.com [IPv6:2600:3c01::f03c:91ff:fe73:2daa]) by greenhill.hpalace.com (Postfix) with ESMTPSA id 94153A45; Sat, 3 Oct 2020 23:25:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=finder.org; s=2018; t=1601767542; bh=s6XLLPV9cEzOq3ahy9+jFOOwOUmtJ48eBtKreeNToxU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=to3dO/vKLGvL0mWpssXukSmPCz9/iyLVm5htsYlK9XOiyiYspY1D6zQ8TfNgIMxiX 1T8tXrs7y3teqcBpATtLBBOl6VXXNcssxV9GRyjxes5PI5LYSxnRw9Jpv0ookTONt+ ikjm3NE/4dblXh9YRLCIVr+Jzivb4FwwqhV66UsmRfeEe/Wz7TCLNWvk7ZLQwa/KD1 9iDbKpoIoI/Eb0So3MqPihTTOQlgSu7NyfT9ITK8p+QkXgKr1pd8ozH2grlR/OIsB2 hmnNukP4S0mVquBZ0HhWwCniWhqa6DkGDxQDAcFETyw5CHOt582EJoOOX1Oh19P6R9 9bh3r3c7M5r2A== In-Reply-To: <72bbff31bcf46be917c9e8d8236cad75@finder.org> X-Sender: jared@finder.org Received-SPF: pass client-ip=2600:3c01::f03c:91ff:fe73:2daa; envelope-from=jared@finder.org; helo=greenhill.hpalace.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:257000 Archived-At: On 2020-10-03 3:28 pm, Jared Finder wrote: > On 2020-10-03 12:26 pm, Jared Finder wrote: >> On 2020-10-03 1:50 am, Eli Zaretskii wrote: >>>> Date: Fri, 02 Oct 2020 17:16:55 -0700 >>>> From: Jared Finder >>>> Cc: emacs-devel@gnu.org >>>> >>>> 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.) >> >> From injecting debug logs into read_menu_input, I can observe that >> tty-menu-mouse-movement is never received so the highlighted item >> never changes except due to keyboard input. And from tracing >> xterm-mouse--read-event-sequence, it appears that Emacs normally does >> not receive xterm mouse motion events unless a button is pressed. >> >> This appears to be due to xt-mouse sending event code 1002 instead of >> 1003 (see >> https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking). >> >> Just sending 1003 instead doesn't just work, but I do see mouse events >> now coming through. Let me do some more investigation here and I will >> get back to you. > > It wasn't that much more work to get xterm-mouse to work. I've > attached an updated patch. > > I have just one question, corresponding to the remaining TODO: > > Now there are newly emitted events for mouse-movement that are not > handled such as " " or " > ". It'd be easy enough to bind all of these to ignore > and further update tty-menu-navigation-map to have more cases, but is > that the right solution? I'm surprised that only xterm-mouse would run > into this case. Apologies, I mistakenly included some exploratory code in my previous patch. The changes in term_mouse_position are unneeded. -- MJF