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#41156: margins interfere with xterm-mouse-mode Date: Mon, 14 Jun 2021 20:51:33 -0700 Message-ID: References: <2E809CFD-2C79-4529-BB68-4510A0F7C4D9@gmail.com> <87o8ca3qyp.fsf_-_@gnus.org> <87czso1un5.fsf@gnus.org> <831r947gfy.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="21453"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Roundcube Webmail/1.3.16 Cc: rudalics@gmx.at, Lars Ingebrigtsen , 41156@debbugs.gnu.org, neil.okamoto@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 15 05:52:09 2021 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 1lt07V-0005Q8-6h for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 15 Jun 2021 05:52:09 +0200 Original-Received: from localhost ([::1]:38924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lt07U-0006LO-8T for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 14 Jun 2021 23:52:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55192) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lt07O-0006IY-2t for bug-gnu-emacs@gnu.org; Mon, 14 Jun 2021 23:52:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36490) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lt07N-0001z7-Qg for bug-gnu-emacs@gnu.org; Mon, 14 Jun 2021 23:52:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lt07N-00038v-QY for bug-gnu-emacs@gnu.org; Mon, 14 Jun 2021 23:52:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jared Finder Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Jun 2021 03:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41156 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 41156-submit@debbugs.gnu.org id=B41156.162372909712038 (code B ref 41156); Tue, 15 Jun 2021 03:52:01 +0000 Original-Received: (at 41156) by debbugs.gnu.org; 15 Jun 2021 03:51:37 +0000 Original-Received: from localhost ([127.0.0.1]:48036 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lt06y-000385-Ki for submit@debbugs.gnu.org; Mon, 14 Jun 2021 23:51:36 -0400 Original-Received: from greenhill.hpalace.com ([192.155.80.58]:47798) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lt06w-00037x-NM for 41156@debbugs.gnu.org; Mon, 14 Jun 2021 23:51:35 -0400 Original-Received: from mail.finder.org (greenhill.hpalace.com [IPv6:2600:3c01::f03c:91ff:fe73:2daa]) by greenhill.hpalace.com (Postfix) with ESMTPSA id AA241CB; Tue, 15 Jun 2021 03:51:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=finder.org; s=2018; t=1623729093; bh=1FouiQgH9MJamy3WfgfEjpS5cNaXH4BGjrO2eWSk6R8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=08jxEJJs2gEO4Pm5GMoapGBzcfTRbWxBobPUEJxtwZRfVqtjey2f5B4LmWSha++Lb rQ83rNEuWiMGaz2cpIkhQN0SE1AIG1G8YkO4K2GbLqmTgG2CKp3uli1jQLW4Uz2xMa yKLBPNhJs9hu606nZG0ZlNHDL7V5caePW+6v++U8wR5cgs6sawNmNdlV4Y+BQ9YJWI YI+urG5sLKszTAJgcPWCqeHRCxwMyDVQtx8lw/xQY5WvVVX8QWXnT30xmSQiNatCK6 DAjgYL7dhqXjfoe4ydz5UFx9N6qO+x2RYuYiPeULhLFka0vsyDd5ciuiSRdr8sUTnb rTcM2Ong68qmg== In-Reply-To: <831r947gfy.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" Xref: news.gmane.io gmane.emacs.bugs:208523 Archived-At: On 2021-06-14 5:56 am, Eli Zaretskii wrote: >> From: Lars Ingebrigtsen >> Date: Mon, 14 Jun 2021 14:46:22 +0200 >> Cc: 41156@debbugs.gnu.org, Neil Okamoto >> >> martin rudalics 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