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

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

[elpa] externals/transient 3cd1de1695 41/41: Make shadowed buffer curren


From: Jonas Bernoulli
Subject: [elpa] externals/transient 3cd1de1695 41/41: Make shadowed buffer current around forge-format{, -description}
Date: Sun, 12 Nov 2023 20:04:10 -0500 (EST)

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

    Make shadowed buffer current around forge-format{,-description}
---
 lisp/transient.el | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index afba620b91..f71f3e90b3 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -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))
@@ -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)))))
@@ -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))
@@ -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)



reply via email to

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