unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Yuri D'Elia <wavexx@thregr.org>
Cc: wavexx@thregr.org, emacs-devel@gnu.org
Subject: Re: [PATCH] Improve interaction between mouse-drag-region and scroll-margin
Date: Sat, 25 Sep 2021 19:17:21 +0300	[thread overview]
Message-ID: <83zgs0pr3i.fsf@gnu.org> (raw)
In-Reply-To: <20210925160922.114811-1-wavexx@thregr.org> (message from Yuri D'Elia on Sat, 25 Sep 2021 18:09:22 +0200)

> 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.



  reply	other threads:[~2021-09-25 16:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-25 16:09 [PATCH] Improve interaction between mouse-drag-region and scroll-margin Yuri D'Elia
2021-09-25 16:17 ` Eli Zaretskii [this message]
2021-09-25 16:31   ` Yuri D'Elia
2021-09-25 16:41     ` Eli Zaretskii
2021-09-25 17:03       ` Yuri D'Elia
2021-09-25 17:19         ` Eli Zaretskii
2021-09-25 17:31           ` Yuri D'Elia

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=83zgs0pr3i.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=wavexx@thregr.org \
    /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).