Skip to content

Commit

Permalink
transient--init-transient: New function
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsius committed Oct 18, 2024
1 parent 4cd1c31 commit 08b27a6
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions lisp/transient.el
Original file line number Diff line number Diff line change
Expand Up @@ -2074,8 +2074,7 @@ EDIT may be non-nil."
(edit
;; Returning from help to edit.
(setq transient--editp t)))
(transient--init-objects name layout params)
(transient--init-keymaps)
(transient--init-transient name layout params)
(transient--history-init transient--prefix)
(setq transient--original-window (selected-window))
(setq transient--original-buffer (current-buffer))
Expand All @@ -2093,6 +2092,18 @@ value. Otherwise return CHILDREN as is."
(funcall (oref group setup-children) children)
children))

(defun transient--init-transient (&optional name layout params)
(unless name
;; Re-init.
(if (eq transient--refreshp 'updated-value)
;; Preserve the prefix value this once, because the
;; invoked suffix indicates that it has updated that.
(setq transient--refreshp (oref transient--prefix refresh-suffixes))
;; Otherwise update the prefix value from suffix values.
(oset transient--prefix value (transient-get-value))))
(transient--init-objects name layout params)
(transient--init-keymaps))

(defun transient--init-keymaps ()
(setq transient--predicate-map (transient--make-predicate-map))
(setq transient--transient-map (transient--make-transient-map))
Expand Down Expand Up @@ -2306,14 +2317,7 @@ value. Otherwise return CHILDREN as is."
(transient--pop-keymap 'transient--predicate-map)
(transient--pop-keymap 'transient--transient-map)
(transient--pop-keymap 'transient--redisplay-map)
(if (eq transient--refreshp 'updated-value)
;; Preserve the prefix value this once, because the
;; invoked suffix indicates that it has updated that.
(setq transient--refreshp (oref transient--prefix refresh-suffixes))
;; Otherwise update the prefix value from suffix values.
(oset transient--prefix value (transient-get-value)))
(transient--init-objects)
(transient--init-keymaps)
(transient--init-transient)
(transient--push-keymap 'transient--transient-map)
(transient--push-keymap 'transient--redisplay-map)
(transient--redisplay))
Expand Down

0 comments on commit 08b27a6

Please sign in to comment.