all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattiase@acm.org>
To: 38641@debbugs.gnu.org
Cc: Konrad Podczeck <konrad.podczeck@univie.ac.at>
Subject: bug#38641: 27.0.50; Misbehavior when drawing a rectangular selection with the mouse
Date: Mon, 16 Dec 2019 22:58:11 +0100	[thread overview]
Message-ID: <E9C8DAD4-440C-4A74-B032-03CFC2FF016A@acm.org> (raw)
In-Reply-To: <C07D00FA-6122-4464-A3D4-1CFA8E41FBC9@univie.ac.at>

[-- Attachment #1: Type: text/plain, Size: 50 bytes --]

Thanks for the report. Would you try this patch?


[-- Attachment #2: 0001-Adjust-cursor-column-when-auto-scrolling-during-rect.patch --]
[-- Type: application/octet-stream, Size: 1925 bytes --]

From f82164d1ca70fe7eb2208889cdf0ad2bdd1a06ec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?= <mattiase@acm.org>
Date: Mon, 16 Dec 2019 22:42:16 +0100
Subject: [PATCH] Adjust cursor column when auto-scrolling during rectangle
 selection

* lisp/mouse.el (mouse-drag-region-rectangle):
Move cursor to the correct column during auto-scrolling both when
crutches are used and not (bug#38641).
---
 lisp/mouse.el | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lisp/mouse.el b/lisp/mouse.el
index 32996b2ede..e9156ffe35 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -2037,7 +2037,11 @@ mouse-drag-region-rectangle
                                (funcall adjusted-col mouse-col) 'point)
                             (unless mouse--rectangle-track-cursor
                               (forward-char))
-                            (rectangle--reset-point-crutches)))))
+                            (rectangle--reset-point-crutches))))
+               (scroll-adjust (lambda ()
+                                (move-to-column
+                                 (funcall adjusted-col mouse-col))
+                                (funcall set-col))))
           (if (and (eq window start-window)
                    mouse-row
                    (<= top mouse-row (1- bottom)))
@@ -2051,11 +2055,11 @@ mouse-drag-region-rectangle
              ((< mouse-row top)
               (mouse-scroll-subr
                start-window (- mouse-row top) nil start-point
-               set-col))
+               scroll-adjust))
              ((>= mouse-row bottom)
               (mouse-scroll-subr
                start-window (1+ (- mouse-row bottom)) nil start-point
-               set-col)))))))
+               scroll-adjust)))))))
     (condition-case err
         (progn
           (setq track-mouse t)
-- 
2.21.0 (Apple Git-122.2)


  reply	other threads:[~2019-12-16 21:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-16 20:07 bug#38641: 27.0.50; Misbehavior when drawing a rectangular selection with the mouse Konrad Podczeck
2019-12-16 21:58 ` Mattias Engdegård [this message]
2019-12-16 23:21   ` Konrad Podczeck
2019-12-17  9:05     ` Mattias Engdegård

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

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

  git send-email \
    --in-reply-to=E9C8DAD4-440C-4A74-B032-03CFC2FF016A@acm.org \
    --to=mattiase@acm.org \
    --cc=38641@debbugs.gnu.org \
    --cc=konrad.podczeck@univie.ac.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.