[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New Context Menu and mouse-1
From: |
Stefan Monnier |
Subject: |
Re: New Context Menu and mouse-1 |
Date: |
Fri, 27 Aug 2021 18:01:54 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> diff --git a/lisp/mouse.el b/lisp/mouse.el
> index 7d3ed9a0e4..933ad5181e 100644
> --- a/lisp/mouse.el
> +++ b/lisp/mouse.el
> @@ -1578,9 +1578,7 @@ mouse-drag-track
> map)
> t (lambda ()
> (setq track-mouse old-track-mouse)
> - (setq auto-hscroll-mode auto-hscroll-mode-saved)
> - (deactivate-mark)
> - (pop-mark)))))
> + (setq auto-hscroll-mode auto-hscroll-mode-saved)))))
>
> (defun mouse--drag-set-mark-and-point (start click click-count)
> (let* ((range (mouse-start-end start click click-count))
>
> Then everything works fine: the aforementioned case
> and the normal using mouse-1 to select a region.
Note that this changes conceptually what `mouse-drag-track` does.
Instead of only giving visual feedback during a drag, it actually does
select the region (whereas in the current code, the region selection is
actually performed by the binding of `drag-mouse-1` to `mouse-set-region`).
So the above will lead to `mouse-set-region` being called when the
region has already been set (at least in terminals that provide
`mouse-movement` events).
I'm not sure if it can introduce problems, but it would deserve
a comment about the fact that the region selection is performed
"redundantly" here and in `mouse-set-region` and why it's done this way.
>From what I remember about the last time I worked in this code, it's
a somewhat messy area.
BTW, maybe another way to look at the problem is to say that
invoking the context-menu should not exit the transient map (but this
may come with its own set of problems, of course).
Related to this, I wonder if `down-mouse-1` .. move .. `down-mouse-3`,
`up-mouse-3` ... `up-mouse-1` would and/or should generate
a `drag-mouse-1` event.
Stefan
- Re: New Context Menu, (continued)
- Re: New Context Menu, Ergus, 2021/08/19
- Re: New Context Menu, Juri Linkov, 2021/08/20
- Re: New Context Menu, Ergus, 2021/08/20
- Re: New Context Menu, Juri Linkov, 2021/08/20
- Re: New Context Menu, Ergus, 2021/08/21
- Re: New Context Menu, Juri Linkov, 2021/08/22
Re: New Context Menu and mouse-1, Juri Linkov, 2021/08/27
- Re: New Context Menu and mouse-1, Eli Zaretskii, 2021/08/27
- Re: New Context Menu and mouse-1, Juri Linkov, 2021/08/27
- Re: New Context Menu and mouse-1,
Stefan Monnier <=
- Re: New Context Menu and mouse-1, Juri Linkov, 2021/08/28
- Re: New Context Menu and mouse-1, Juri Linkov, 2021/08/29
- Re: New Context Menu and mouse-1, Juri Linkov, 2021/08/30
- Re: New Context Menu and mouse-1, Stefan Monnier, 2021/08/30