[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Improve interaction between mouse-drag-region and scroll-mar
From: |
Eli Zaretskii |
Subject: |
Re: [PATCH] Improve interaction between mouse-drag-region and scroll-margin |
Date: |
Sat, 25 Sep 2021 19:17:21 +0300 |
> From: Yuri D'Elia <wavexx@thregr.org>
> Date: Sat, 25 Sep 2021 18:09:22 +0200
> Cc: Yuri D'Elia <wavexx@thregr.org>
>
> * lisp/mouse.el (mouse-drag-track): Disable both scroll-margin and
> auto-hscroll-mode in mouse-drag-region and do not re-enable them until
> dragging is over, making selections work as expected when inside the
> margins.
If you disable auto-hscroll-mode, why do you also need to zero out
hscroll-margin?
> + ;; Suppress automatic scrolling near the edges while tracking
> + ;; movement, as it interferes with the natural dragging behavior
> + ;; (point will unexpectedly be moved beneath the pointer, making
> + ;; selections in auto-scrolling margins impossible).
> + (setq auto-hscroll-mode nil)
> + (setq scroll-margin 0)
Shouldn't this be in unwind-protect? What happens if Emacs signals an
error or there's a quit while in this code?
And I think this also warrants a NEWS entry.
Thanks.