unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Jared Finder via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: stephen.berman@gmx.net, 67457@debbugs.gnu.org,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	visuweshm@gmail.com
Subject: bug#67457: 29.1; Error when dragging mode line in terminal
Date: Wed, 06 Dec 2023 15:55:04 -0800	[thread overview]
Message-ID: <d69d32091de8ffb9fa576b226091f6bc@finder.org> (raw)
In-Reply-To: <83msuz88am.fsf@gnu.org>

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	other threads:[~2023-12-06 23:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-26 17:31 bug#67457: 29.1; Error when dragging mode line in terminal Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-26 18:03 ` Eli Zaretskii
2023-11-26 18:09   ` Visuwesh
2023-11-26 18:19     ` Eli Zaretskii
2023-11-26 22:08       ` Stephen Berman
2023-11-27  0:24         ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-27  9:05           ` Stephen Berman
2023-11-27 12:37           ` Eli Zaretskii
2023-11-27 15:16             ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-27 16:34               ` Eli Zaretskii
2023-12-06 23:55                 ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-12-07 22:35                   ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-08 16:18                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-09  8:19                     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d69d32091de8ffb9fa576b226091f6bc@finder.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=67457@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=jared@finder.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=stephen.berman@gmx.net \
    --cc=visuweshm@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).