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

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

[elpa] externals/transient 9259f77e14 05/25: transient-args: Allow PREFI


From: Jonas Bernoulli
Subject: [elpa] externals/transient 9259f77e14 05/25: transient-args: Allow PREFIX to be a list of prefixes
Date: Tue, 3 Dec 2024 14:35:01 -0500 (EST)

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

    transient-args: Allow PREFIX to be a list of prefixes
---
 lisp/transient.el | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index 14b63598c7..87b83dcaf8 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -3541,10 +3541,16 @@ See also `transient-prefix-set'.")
 
 (defun transient-args (prefix)
   "Return the value of the transient prefix command PREFIX.
-If the current command was invoked from the transient prefix
-command PREFIX, then return the active infix arguments.  If
-the current command was not invoked from PREFIX, then return
-the set, saved or default value for PREFIX."
+
+If the current command was invoked from the transient prefix command
+PREFIX, then return the active infix arguments.  If the current command
+was not invoked from PREFIX, then return the set, saved or default value
+for PREFIX.
+
+PREFIX may also be a list of prefixes.  If no prefix is active, the
+fallback value of the first of these prefixes is used."
+  (when (listp prefix)
+    (setq prefix (car (or (memq transient-current-command prefix) prefix))))
   (mapcan #'transient--get-wrapped-value (transient-suffixes prefix)))
 
 (defun transient-suffixes (prefix)



reply via email to

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