[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New Context Menu and mouse-1

From: Juri Linkov
Subject: Re: New Context Menu and mouse-1
Date: Fri, 27 Aug 2021 20:03:31 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

>>  <down-mouse-1>          ;; mouse-drag-region
>>  <mouse-movement>        ;; anonymous-command
>>  <mouse-movement>        ;; anonymous-command
>>  <mouse-movement>        ;; anonymous-command
>>  <down-mouse-3> <cut>    ;; kill-region
>> I have no idea how this could be fixed.
> Why do you need mouse-set-region to be invoked?  And if you do, why
> cannot the command bound to down-mouse-3 do that?

There should be no need to invoke mouse-set-region,
because <mouse-movement> already sets the region.
And indeed, the minimal change that fixes this problem
is just removing these lines:

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]