emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/transient 23fab3a114 075/366: Bring back mouse support


From: Jonas Bernoulli
Subject: [elpa] externals/transient 23fab3a114 075/366: Bring back mouse support in transient popups
Date: Tue, 25 Jan 2022 18:54:28 -0500 (EST)

branch: externals/transient
commit 23fab3a11413f97f830299f693d30e309dfe8a34
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    Bring back mouse support in transient popups
---
 lisp/transient.el | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lisp/transient.el b/lisp/transient.el
index 9da2714ee3..bb4bacd1d7 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -103,6 +103,7 @@ features are available:
 - \"<up>\" moves the cursor to the previous suffix.
   \"<down>\" moves the cursor to the next suffix.
   \"RET\" invokes the suffix the cursor is on.
+- \"<mouse-1>\" invokes the clicked on suffix.
 "
   :package-version '(transient . "0.2.0")
   :group 'transient
@@ -1250,6 +1251,8 @@ edited using the same functions as used for transients.")
     (define-key map [transient-scroll-up]     'transient--do-stay)
     (define-key map [transient-scroll-down]   'transient--do-stay)
     (define-key map [mwheel-scroll]           'transient--do-stay)
+    (define-key map [transient-noop]              'transient--do-noop)
+    (define-key map [transient-mouse-push-button] 'transient--do-move)
     (define-key map [transient-push-button]       'transient--do-move)
     (define-key map [transient-backward-button]   'transient--do-move)
     (define-key map [transient-forward-button]    'transient--do-move)
@@ -2874,6 +2877,8 @@ resumes the suspended transient.")
 
 (defvar transient-popup-navigation-map
   (let ((map (make-sparse-keymap)))
+    (define-key map (kbd "<down-mouse-1>") 'transient-noop)
+    (define-key map (kbd "<mouse-1>") 'transient-mouse-push-button)
     (define-key map (kbd "RET")       'transient-push-button)
     (define-key map (kbd "<up>")      'transient-backward-button)
     (define-key map (kbd "C-p")       'transient-backward-button)
@@ -2881,6 +2886,11 @@ resumes the suspended transient.")
     (define-key map (kbd "C-n")       'transient-forward-button)
     map))
 
+(defun transient-mouse-push-button (&optional pos)
+  "Invoke the suffix the user clicks on."
+  (interactive (list last-command-event))
+  (push-button pos))
+
 (defun transient-push-button ()
   "Invoke the selected suffix command."
   (interactive)



reply via email to

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