Skip to content

Commit

Permalink
[wip] mouse experiments
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsius committed May 16, 2024
1 parent 244871c commit e6d9767
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions lisp/transient.el
Original file line number Diff line number Diff line change
Expand Up @@ -1790,7 +1790,7 @@ to `transient-predicate-map'. Also see `transient-base-map'."
(defvar-keymap transient-popup-navigation-map
:doc "One of the keymaps used when popup navigation is enabled.
See `transient-enable-popup-navigation'."
"<down-mouse-1>" #'transient-noop
;; "<down-mouse-1>" #'transient-noop ; mouse-drag-region
"<up>" #'transient-backward-button
"<down>" #'transient-forward-button
"C-r" #'transient-isearch-backward
Expand Down Expand Up @@ -1872,7 +1872,8 @@ of the corresponding object."
"<nil>" #'transient--do-warn
;; Bound to the `mouse-movement' event, this command is similar
;; to `ignore'.
"<ignore-preserving-kill-region>" #'transient--do-noop)
"<ignore-preserving-kill-region>" #'transient--do-noop
)

(defvar transient--transient-map nil)
(defvar transient--predicate-map nil)
Expand Down Expand Up @@ -2527,6 +2528,23 @@ value. Otherwise return CHILDREN as is."
(defun transient--post-command ()
(unless (transient--premature-post-command)
(transient--debug 'post-command)
;; (message "-- (and %s %s) %s %s"
;; (eq (selected-window) transient--window)
;; (not (or (eq this-command 'mouse-drag-region)
;; (eq (car-safe (aref (this-command-keys-vector) 0))
;; 'mouse-movement)))
;; this-command
;; (car-safe (aref (this-command-keys-vector) 0)))
(when (and (eq (selected-window) transient--window)
;; Don't add `mouse-set-region' itself as that would get
;; the region stuck in the transient buffer or the original
;; buffer. The region still gets added to the kill ring.
(not (or (eq this-command 'mouse-drag-region)
(eq (car-safe (aref (this-command-keys-vector) 0))
'mouse-movement))))
(deactivate-mark)
;; (setq mark-active nil)
(select-window transient--original-window))
(transient--with-emergency-exit :post-command
(cond (transient--exitp (transient--post-exit))
;; If `this-command' is the current transient prefix, then we
Expand Down

0 comments on commit e6d9767

Please sign in to comment.