From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: mouse-face and help echo support for xterm mouse Date: Thu, 05 Nov 2020 15:18:12 -0500 Message-ID: References: <946d9ea094642758037d1881a97e8d0c@finder.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15566"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: "Jared Finder via \"Emacs development discussions.\"" To: Jared Finder Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 05 21:19:35 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 1kaljL-0003vV-C3 for ged-emacs-devel@m.gmane-mx.org; Thu, 05 Nov 2020 21:19:35 +0100 Original-Received: from localhost ([::1]:37174 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kaljK-00049F-D2 for ged-emacs-devel@m.gmane-mx.org; Thu, 05 Nov 2020 15:19:34 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40174) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaliC-0002iD-Gx for emacs-devel@gnu.org; Thu, 05 Nov 2020 15:18:25 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:21662) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kali8-000660-Rg for emacs-devel@gnu.org; Thu, 05 Nov 2020 15:18:23 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 0346B80438; Thu, 5 Nov 2020 15:18:19 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 5C9FB809BF; Thu, 5 Nov 2020 15:18:13 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1604607493; bh=Z9QsUQPhlnN4RnBzq2UzMl1r4b3CIS8xSv+KSNAqKmE=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=ltWXGpuVo0E2oMRirQ5QBaJA7lKKPEIlMe5nZluLPQ+dc9h4J1Ngqppzv5/xXCdtP CD0Dlp4RhuWWOu0WoXhsqRJOJZbviGwm/3CpnppHXZOzwwFv7aN+lvKCZS7+YW3trm Tk9u87fqRCdjlptffsaZ2zuwVhQWHcD4VHEzVfkJ51s+WmOyNJawjTlc4UCJwkX/dG xHQGt4uAWc55Em8k+b1C16RQARsS/Yu0w3M39t/gD1WACiKkq9a3myOv2NRC5rzG1g 0j6kiNC0xCo58J/Mxbh4oz3+1nf5e6Sg/POFzrCCYuKpMIDMvYEa/Qg0JQ/Fu8wRUz ZvlZJZwHwlOzQ== Original-Received: from alfajor (unknown [157.52.9.240]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1B0F01203CF; Thu, 5 Nov 2020 15:18:13 -0500 (EST) In-Reply-To: <946d9ea094642758037d1881a97e8d0c@finder.org> (Jared Finder's message of "Thu, 05 Nov 2020 11:58:09 -0800") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/05 09:21:03 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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:258756 Archived-At: > Using ev-data's x,y would add significant complexity. ev-data is a posn, > which is window part relative, not frame relative. Fair enough. >>> +(defun xterm-mouse--handle-mouse-motion () >>> + "Handle mouse motion that was just generated for XTerm mouse." >>> + (let ((frame (selected-frame))) >>> + (handle-lisp-mouse-motion frame >>> + (terminal-parameter frame 'xterm-mouse-x) >>> + (terminal-parameter frame >>> 'xterm-mouse-y)))) >> This is the only caller to `handle-lisp-mouse-motion` and that function >> has a "default frame to selected-frame" feature, so you could pass nil >> instead of `frame`. Better yet, drop that frame argument altogether. >> And I think the function's name should make it clear it's for internal >> use only, or otherwise try to use some prefix that indicates it's >> related to the display. Like `display-update-for-mouse-motion`? > Is there a way I can name it that makes it clear this is an internal > function and we may change the arguments in the future? I'd suggest `display--update-for-mouse-action`, then. > I was hoping that this function would work with background frames > across different TTYs in case I can figure out how to get > that working. Not sure why that would require a frame that's not `selected_frame`. >> [ I'm reminded here of the tension between using "mouse-motion" >> because it's shorter and using "mouse-movement" because that's the >> name of the event. ] > I squared this circle by using "mouse motion" for the concept and "mouse > movement" for the event. Sounds good. >> Would it make sense to try and add this test to the "generic" part of >> the code? > This is not possible without much further work. These are all tied with the > C mouse event path: last_mouse_x, last_mouse_y, and frame.mouse_moved are > all used by the mouse position hook and integrated with keyboard.c's mouse > event generation. Fair enough. Maybe you can add a brief FIXME comment explaining just that (or pointing to this discussion). Stefan