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 "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#67457: 29.1; Error when dragging mode line in terminal Date: Wed, 06 Dec 2023 15:55:04 -0800 Message-ID: References: <756e757b61f27b310fdb2dc2567bee36@finder.org> <83r0kc9yu3.fsf@gnu.org> <878r6kcro6.fsf@gmail.com> <83o7fg9y2m.fsf@gnu.org> <8734wsdv7f.fsf@gmx.net> <834jh79xsx.fsf@gnu.org> <83msuz88am.fsf@gnu.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="29960"; mail-complaints-to="usenet@ciao.gmane.io" Cc: stephen.berman@gmx.net, 67457@debbugs.gnu.org, Stefan Monnier , visuweshm@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 07 00:56:37 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1rB1kr-0007a7-1O for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 07 Dec 2023 00:56:37 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rB1kG-00017D-7F; Wed, 06 Dec 2023 18:56:01 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rB1k6-00016l-BV for bug-gnu-emacs@gnu.org; Wed, 06 Dec 2023 18:55:51 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rB1k6-0001go-3R for bug-gnu-emacs@gnu.org; Wed, 06 Dec 2023 18:55:50 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rB1kH-0000d0-OU for bug-gnu-emacs@gnu.org; Wed, 06 Dec 2023 18:56:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jared Finder Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Dec 2023 23:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67457 X-GNU-PR-Package: emacs Original-Received: via spool by 67457-submit@debbugs.gnu.org id=B67457.17019069212348 (code B ref 67457); Wed, 06 Dec 2023 23:56:01 +0000 Original-Received: (at 67457) by debbugs.gnu.org; 6 Dec 2023 23:55:21 +0000 Original-Received: from localhost ([127.0.0.1]:40677 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rB1jc-0000bo-Jf for submit@debbugs.gnu.org; Wed, 06 Dec 2023 18:55:20 -0500 Original-Received: from greenhill.hpalace.com ([192.155.80.58]:43920) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rB1jZ-0000bb-V7 for 67457@debbugs.gnu.org; Wed, 06 Dec 2023 18:55:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=finder.org; s=2018; t=1701906904; bh=kBRaDays/T8HN8SJyCgrT2TzhKvkKkTsmhlKo9bwkTE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=XI10SgS8j0nZiDEkegVhXbOBX8TbnlHeO129iN10y6M2pwFnzurfDEAbwPGL+oXDV JhtmST174IvEUmbE2b3Yb0hUHOPJlFYHj1NZW/ETVGpJ77aDZdex3pQGDPevzNgzt9 8tiU1dwo7BCLRUXqq6kse4oTtOp9w5WtWyDj4pb1gTlBMfVKTkStxfr/8J05EH1U69 DmuyNqEkswaUvUobz3ULXNsKc6kiIjGjOQp3LBsNQSHGSkljH/X7QvDGnPiTh1ngRM L+OLL2aIwdykchlbSPfjFnhjFdNV8x561V89j4uH0K5MzGwKC8tS44EA23QUPrs90c G+lFz9To9x29g== Original-Received: from mail.finder.org (unknown [192.155.80.58]) by greenhill.hpalace.com (Postfix) with ESMTPSA id C449B42F1; Wed, 6 Dec 2023 23:55:04 +0000 (UTC) In-Reply-To: <83msuz88am.fsf@gnu.org> X-Sender: jared@finder.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:275633 Archived-At: On 2023-11-27 08:34, Eli Zaretskii wrote: >> Date: Mon, 27 Nov 2023 07:16:34 -0800 >> From: Jared Finder >> Cc: stephen.berman@gmx.net, visuweshm@gmail.com, 67457@debbugs.gnu.org >> >> >> 1. My original patch is likely inaccurate. A better fix would be to >> >> align the mouse-movement event with how it is emitted under GPM and >> >> DOS. >> >> I will investigate. >> >> >> >> 2. Something broke with how GPM mouse mode is enabled between Emacs >> >> 28.2 >> >> and HEAD. I can help with a bisect here. >> > >> > Thanks, please do, on both counts. >> >> Bisect identified the following commit as the bad commit, confirmed >> locally: >> >> jared@debian:^/emacs-devel$ git bisect bad >> a28ede3a61a70cf83dfcba6c9d314fbb051a3a94 is the first bad commit >> commit a28ede3a61a70cf83dfcba6c9d314fbb051a3a94 >> Author: Stefan Monnier >> Date: >> t-mouse.el: Make sure we apply the setting to new terminals >> * lisp/t-mouse.el (gpm-mouse-tty-setup): New function. >> (gpm-mouse-mode): Use it as well as 'tty-setup-hook". >> * lisp/term/linux.el (terminal-init-linux): Remove gpm-specific code, >> not neded any more. >> lisp/t-mouse.el >> lisp/term/linux.el | 2 -- > > Thanks, adding Stefan to the discussion. Following up on #2: The issue here is that after a28ede, gpm-mouse-tty-setup is never added to tty-setup-hook since it is only added within gpm-mouse-mode. This is clearly visible by checking the value of tty-setup-hook at startup, and after toggling gpm-mouse-mode off and on again. The following simple patch fixes that, while leaving the details of how gpm-mouse-mode works an internal detail: --- a/lisp/term/linux.el +++ b/lisp/term/linux.el @@ -13,6 +13,9 @@ terminal-init-linux ;; Compositions confuse cursor movement. (setq-default auto-composition-mode "linux") + ;; Ensure additional terminal setup is done when `gpm-mouse-mode' is enabled. + (ignore-errors (when gpm-mouse-mode (gpm-mouse-mode 1))) + ;; Don't translate ESC TAB to backtab as directed by ncurses-6.3. (define-key input-decode-map "\e\t" nil) One could also just revert just the linux.el changes in a28ede, though that assumes that gpm-mouse-enable exists. -- MJF