emacs-devel
[Top][All Lists]
Advanced

[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: Sun, 29 Aug 2021 19:53:56 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

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

The problem is that not to exit the transient map
it's not possible to check for some known events,
because e.g. selecting "Cut" produces 'cut',
and other such symbols.

So the other way around would be to check for
the known events and then deactivate the mark.
This is necessary because otherwise simply clicking mouse-1
will activate the mark and leave it active afterwards.

diff --git a/lisp/mouse.el b/lisp/mouse.el
index 7d3ed9a0e4..e97352cdf8 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -1579,8 +1579,9 @@ mouse-drag-track
      t (lambda ()
          (setq track-mouse old-track-mouse)
          (setq auto-hscroll-mode auto-hscroll-mode-saved)
-         (deactivate-mark)
-         (pop-mark)))))
+         (when (memq (car-safe last-input-event) '(mouse-1 drag-mouse-1))
+           (deactivate-mark)
+           (pop-mark))))))

This still exits the transient map in both cases, and I don't know
how not to exit the transient map only for events from the context-menu.



reply via email to

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