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: mouse-face and help echo support for xterm mouse Date: Wed, 04 Nov 2020 17:19:57 +0200 Message-ID: <83pn4tb142.fsf@gnu.org> References: <31ff05295c806c4596c54fdcc8994a5f@finder.org> <3e7e0f6d1e272d03913e97254b2eabff@finder.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6335"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Jared Finder Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Nov 04 16:27:55 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 1kaKhR-0001QC-R9 for ged-emacs-devel@m.gmane-mx.org; Wed, 04 Nov 2020 16:27:49 +0100 Original-Received: from localhost ([::1]:33876 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kaKhQ-0000YA-Nl for ged-emacs-devel@m.gmane-mx.org; Wed, 04 Nov 2020 10:27:48 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59576) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaKZx-0006e8-EI for emacs-devel@gnu.org; Wed, 04 Nov 2020 10:20:06 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:41317) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kaKZw-0007zY-AM; Wed, 04 Nov 2020 10:20:04 -0500 Original-Received: from [176.228.60.248] (port=2853 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kaKZu-0007E4-9F; Wed, 04 Nov 2020 10:20:02 -0500 In-Reply-To: <3e7e0f6d1e272d03913e97254b2eabff@finder.org> (emacs-devel@gnu.org) 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:258678 Archived-At: > Date: Tue, 03 Nov 2020 22:54:32 -0800 > Cc: "Jared Finder via \"Emacs development discussions.\"" > From: Jared Finder via "Emacs development discussions." > > Toward proving that the code could be shared, I refactored the GPM mouse > logic so that it was clearly apparent how to share it with > handle-lisp-mouse-motion. That patch is attached. I'd like to make > sure this looks like an appropriate change to make. If so, I will > finish up the patch. Thanks, see below. > Two specific questions: > > 1. To enable sharing logic, I need to encode a handful of assumptions > that I believe are true today (example: no need to handle quit-char in > GPM handling). Do these assumptions look reasonable? Not sure why is this important. You want to remove the hold_quit stuff from the code? I don't see that it complicates the code, so I'd suggest not to waste your time on worrying about it. Just leave it alone. > 2. In what file should such a shared function go? My initial thought is > a new file "mouse.c" as it would hold shared mouse logic. No, new file for a single function is too much. dispnew.c, I guess. > while (gpm = Gpm_GetEvent (&event), gpm == 1) { > - nread += handle_one_term_event (tty, &event, &gpm_hold_quit); > + nread += handle_one_term_event (tty, &event); As explained above, I'd leave the signature alone, because it is not guaranteed that every subroutine we call here doesn't need to use it. > - if (ie.kind != NO_EVENT) I also don't think it's a good idea to remove this test. The functions you call don't guarantee to always return a meaningful event, and the assertion you leave instead is too drastic: imagine that it happens to some innocent user. > + kbd_buffer_store_event_hold (&ie, NULL); If we eventually decide not to use the hold_quit stuff, you can just call kbd_buffer_store_event here. Thanks.