Skip to content

Commit

Permalink
Make shadowed buffer current around forge-format{,-description}
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsius committed Nov 12, 2023
1 parent d44c4fc commit 3cd1de1
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions lisp/transient.el
Original file line number Diff line number Diff line change
Expand Up @@ -3503,7 +3503,8 @@ have a history of their own.")

(cl-defmethod transient--insert-group :around ((group transient-group))
"Insert GROUP's description, if any."
(when-let ((desc (transient-format-description group)))
(when-let ((desc (transient-with-shadowed-buffer
(transient-format-description group))))
(insert desc ?\n))
(let ((transient--max-group-level
(max (oref group level) transient--max-group-level))
Expand All @@ -3513,14 +3514,14 @@ have a history of their own.")
(cl-defmethod transient--insert-group ((group transient-row))
(transient--maybe-pad-keys group)
(dolist (suffix (oref group suffixes))
(insert (transient-format suffix))
(insert (transient-with-shadowed-buffer (transient-format suffix)))
(insert " "))
(insert ?\n))

(cl-defmethod transient--insert-group ((group transient-column))
(transient--maybe-pad-keys group)
(dolist (suffix (oref group suffixes))
(let ((str (transient-format suffix)))
(let ((str (transient-with-shadowed-buffer (transient-format suffix))))
(insert str)
(unless (string-match-p ".\n\\'" str)
(insert ?\n)))))
Expand All @@ -3530,10 +3531,11 @@ have a history of their own.")
(mapcar
(lambda (column)
(transient--maybe-pad-keys column group)
(let ((rows (mapcar #'transient-format (oref column suffixes))))
(when-let ((desc (transient-format-description column)))
(push desc rows))
(flatten-tree rows)))
(transient-with-shadowed-buffer
(let ((rows (mapcar #'transient-format (oref column suffixes))))
(when-let ((desc (transient-format-description column)))
(push desc rows))
(flatten-tree rows))))
(oref group suffixes)))
(vp (or (oref transient--prefix variable-pitch)
transient-align-variable-pitch))
Expand Down Expand Up @@ -3725,10 +3727,9 @@ called inside the correct buffer (see `transient--insert-group')
and its value is returned to the caller."
(and-let* ((desc (oref obj description))
(desc (if (functionp desc)
(transient-with-shadowed-buffer
(if (= (car (func-arity desc)) 1)
(funcall desc obj)
(funcall desc)))
(if (= (car (func-arity desc)) 1)
(funcall desc obj)
(funcall desc))
desc)))
(if-let* ((face (transient--get-face obj 'face)))
(transient--add-face desc face t)
Expand Down

0 comments on commit 3cd1de1

Please sign in to comment.