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: rudalics@gmx.at, Lars Ingebrigtsen <larsi@gnus.org>,
	41156@debbugs.gnu.org, neil.okamoto@gmail.com
Subject: bug#41156: margins interfere with xterm-mouse-mode
Date: Mon, 14 Jun 2021 20:51:33 -0700	[thread overview]
Message-ID: <d4d438c1fe1c8ce79413693ec3c30fa9@finder.org> (raw)
In-Reply-To: <831r947gfy.fsf@gnu.org>

On 2021-06-14 5:56 am, Eli Zaretskii wrote:
>> From: Lars Ingebrigtsen <larsi@gnus.org>
>> Date: Mon, 14 Jun 2021 14:46:22 +0200
>> Cc: 41156@debbugs.gnu.org, Neil Okamoto <neil.okamoto@gmail.com>
>> 
>> martin rudalics <rudalics@gmx.at> writes:
>> 
>> > Unless you do
>> >
>> > (set-window-margins (selected-window) 2 0)
>> >
>> > in the window at right.
>> 
>> Right, so I guess xterm-mouse-mode needs to define a key binding in 
>> the
>> margin area for these mouse commands?
>> 
>> Hm...  Well, I took a quick peek at xt-mouse.el for the first time in 
>> my
>> life, and that doesn't seem to be how that mode works at all.  Is
>> anybody familiar enough with xt-mouse that it's obvious to them what's
>> going wrong in this case?
> 
> Jared, can you help us out here, please?

xterm-mouse-mode is running fine, it is correctly generating 
mouse-motion events with proper X,Y coordinates.

The actual drag keybinding is handled in mouse-drag-line in mouse.el.  
The following patch mostly works for me, though I see issues when 
dragging to the left and the left buffer has a margin of width greater 
than 1.  I think there's some incorrect logic in how the temporarily 
bound move function is converting calculating positions:

@@ -494,9 +494,12 @@ mouse-drag-line
  	       (define-key map [header-line] map)
  	       (define-key map [vertical-line] map)
  	       ;; ... and some maybe even with a right- or bottom-divider
-	       ;; prefix.
+	       ;; prefix ...
  	       (define-key map [right-divider] map)
  	       (define-key map [bottom-divider] map)
+               ;; ... and the margins too.
+               (define-key map [left-margin] map)
+               (define-key map [right-margin] map)
  	       map)
  	     t (lambda () (setq track-mouse old-track-mouse)))))))

I'll investigate a bit more later.

   -- MJF





  reply	other threads:[~2021-06-15  3:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-09 18:21 bug#41156: 26.3; 27.0.91; linum-mode interferes with xterm-mouse-mode Neil Okamoto
2020-05-11 17:14 ` bug#41156: Updated description Neil Okamoto
2021-06-13 12:10   ` bug#41156: margins interfere with xterm-mouse-mode Lars Ingebrigtsen
2021-06-13 14:52     ` martin rudalics
2021-06-14 12:46       ` Lars Ingebrigtsen
2021-06-14 12:56         ` Eli Zaretskii
2021-06-15  3:51           ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2021-06-15  5:29             ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-06-15  7:50               ` martin rudalics
2021-06-15 11:19               ` Eli Zaretskii
2021-06-15 13:54               ` Lars Ingebrigtsen

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=d4d438c1fe1c8ce79413693ec3c30fa9@finder.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=41156@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=jared@finder.org \
    --cc=larsi@gnus.org \
    --cc=neil.okamoto@gmail.com \
    --cc=rudalics@gmx.at \
    /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).