Skip to content

Commit

Permalink
transient-prefix: Add experimental transient-switch-frame slot
Browse files Browse the repository at this point in the history
This is experimental and guaranteed to be changed in not fully (or at
all) backward compatible ways.  Only use this at this time if you are
prepared to deal with that.
  • Loading branch information
tarsius committed Nov 18, 2023
1 parent c55defa commit 609dabf
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lisp/transient.el
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,7 @@ If `transient-save-history' is nil, then do nothing."
(man-page :initarg :man-page :initform nil)
(transient-suffix :initarg :transient-suffix :initform nil)
(transient-non-suffix :initarg :transient-non-suffix :initform nil)
(transient-switch-frame :initarg :transient-switch-frame)
(refresh-suffixes :initarg :refresh-suffixes :initform nil)
(incompatible :initarg :incompatible :initform nil)
(suffix-description :initarg :suffix-description)
Expand Down Expand Up @@ -1763,9 +1764,12 @@ of the corresponding object."
(return (eq default t))
(map (make-sparse-keymap)))
(set-keymap-parent map transient-predicate-map)
(when (memq (transient--resolve-pre-command
(oref transient--prefix transient-non-suffix))
'(nil transient--do-warn transient--do-noop))
(when (or (and (slot-boundp transient--prefix 'transient-switch-frame)
(transient--resolve-pre-command
(not (oref transient--prefix transient-switch-frame))))
(memq (transient--resolve-pre-command
(oref transient--prefix transient-non-suffix))
'(nil transient--do-warn transient--do-noop)))
(define-key map [handle-switch-frame] #'transient--do-suspend))
(dolist (obj transient--suffixes)
(let* ((cmd (oref obj command))
Expand Down

0 comments on commit 609dabf

Please sign in to comment.