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: mouse-face and help echo support for xterm mouse Date: Sun, 01 Nov 2020 07:56:37 -0800 Message-ID: <31ff05295c806c4596c54fdcc8994a5f@finder.org> References: 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="26207"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Roundcube Webmail/1.3.15 Cc: "Jared Finder via \"Emacs development discussions.\"" To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 01 16:58:06 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 1kZFk4-0006j6-UK for ged-emacs-devel@m.gmane-mx.org; Sun, 01 Nov 2020 16:58:04 +0100 Original-Received: from localhost ([::1]:41552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZFk4-0006L6-0e for ged-emacs-devel@m.gmane-mx.org; Sun, 01 Nov 2020 10:58:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kZFik-0005eO-BY for emacs-devel@gnu.org; Sun, 01 Nov 2020 10:56:42 -0500 Original-Received: from greenhill.hpalace.com ([192.155.80.58]:37184) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kZFii-0002Zm-JV for emacs-devel@gnu.org; Sun, 01 Nov 2020 10:56:42 -0500 Original-Received: from mail.finder.org (greenhill.hpalace.com [IPv6:2600:3c01::f03c:91ff:fe73:2daa]) by greenhill.hpalace.com (Postfix) with ESMTPSA id BB5DF7FB; Sun, 1 Nov 2020 15:56:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=finder.org; s=2018; t=1604246197; bh=ebCUmZPpFyKoEG9xWe/la8S7mObbjkkC8Bpe+sFZb64=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=iFSCkdWMTxgq/fou9OkbtPUG+A4RtSnQmATO4EetJKseKinnQmBBtR+kjCUzUrzM4 /f5JNL0n4qJszg1iGnY34jJomIa2T2OfN5KFaX/GCDY81/Qse1xvyEWIFMUXdWvxne TPxTSqKrpmIiwRlvaoeI8ga0FZWBaZt9jdD8cwVTZFQ5KjdCHcApeDozdNfroaOvEn FF/a+6D92qvmoTle5uLBhpOABHJzwcgfXTY7LDFl3iRznRdcQYmDYMH6cxMljO06uk e19S4K6JLBHn23mnRTf5KeaQxZjpvJkc627ExKd+6Qm+Fy06SM4nIln5FwgI+pmcv/ 0nz843jC80H9w== In-Reply-To: X-Sender: jared@finder.org Received-SPF: pass client-ip=192.155.80.58; envelope-from=jared@finder.org; helo=greenhill.hpalace.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/01 10:56:38 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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:258603 Archived-At: On 2020-11-01 5:39 am, Stefan Monnier wrote: > Hi Jared, > > I really like this new feature but have just one comment/question? > >> + previous_help_echo_string = help_echo_string; >> + help_echo_string = Qnil; >> + >> + note_mouse_highlight(XFRAME(frame), XFIXNUM (mouse_x), XFIXNUM >> (mouse_y)); >> + >> + if (!NILP (help_echo_string) >> + || !NILP (previous_help_echo_string)) >> + { >> + gen_help_event (help_echo_string, frame, help_echo_window, >> + help_echo_object, help_echo_pos); >> + } > > I see this exact same code in other C files. > Could we move it to a file where we can share it instead of having > N copies? I completely agree, not just for this code but also for mouse handling in general. I think there should be a shared mouse interface with individual C functions for each type of mouse event: mouse move, mouse click, etc. Translating OS-specific events to this shared functionality would continue to be OS-specific, but the actual handling of these events, such as this logic, would be fully shared. For example, this would unify the different codepaths between TTY menus for GPM, xterm-mouse, and NT Emacs. I would be happy to help with this next. However I need some help. I can only locally build and test for Linux terminal with xterm-mouse or GPM handling the mouse. Is there someone who can help for other platforms? And should the GUI platforms be included as well? (I suspect yes is the right answer.) -- MJF