bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#67457: 29.1; Error when dragging mode line in terminal


From: Jared Finder
Subject: bug#67457: 29.1; Error when dragging mode line in terminal
Date: Wed, 06 Dec 2023 15:55:04 -0800

On 2023-11-27 08:34, Eli Zaretskii wrote:
Date: Mon, 27 Nov 2023 07:16:34 -0800
From: Jared Finder <jared@finder.org>
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 <monnier@iro.umontreal.ca>
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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]