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

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

[elpa] externals/transient 0312b9302d 099/366: transient-args: Remove SE


From: Jonas Bernoulli
Subject: [elpa] externals/transient 0312b9302d 099/366: transient-args: Remove SEPARATE argument
Date: Tue, 25 Jan 2022 18:54:30 -0500 (EST)

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

    transient-args: Remove SEPARATE argument
---
 docs/transient.org | 17 +----------------
 lisp/transient.el  | 37 +++++++++----------------------------
 2 files changed, 10 insertions(+), 44 deletions(-)

diff --git a/docs/transient.org b/docs/transient.org
index e9dd23327e..171817b112 100644
--- a/docs/transient.org
+++ b/docs/transient.org
@@ -1000,7 +1000,7 @@ The preferred way of doing that is to call the 
~transient-args~
 function, which for infix arguments serves about the same purpose as
 ~prefix-arg~ serves for prefix arguments.
 
-- Function: transient-args &optional prefix separate
+- Function: transient-args &optional prefix
 
   This function returns the value of the transient from which the
   current suffix was called.  If the current suffix command was not
@@ -1012,21 +1012,6 @@ function, which for infix arguments serves about the 
same purpose as
   Otherwise ~nil~ is returned.  This function is also used internally,
   in which PREFIX can also be a ~transient-prefix~ object.
 
-  If optional SEPARATE is non-~nil~, then the arguments are separated
-  into two groups.  If SEPARATE is ~t~, they are separated into atoms
-  and conses (~nil~ isn't a valid value, so it doesn't matter that that
-  is both an atom and a cons).
-
-  SEPARATE can also be a predicate function, in which case the first
-  element is a list of the values for which it returns non-~nil~ and the
-  second element is a list of the values for which it returns ~nil~.
-
-  For transients that are used to pass arguments to a subprocess (such
-  as ~git~), ~stringp~ is a useful value for SEPARATE, it separates
-  non-positional arguments from positional arguments.  The value of
-  Magit's file argument (~"--"~) for example looks like this: ~("--"
-  file...)~."
-
 - Variable: current-transient-suffixes
 
   The suffixes of the transient from which this suffix command was
diff --git a/lisp/transient.el b/lisp/transient.el
index ca60c31440..56c1761390 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -2035,7 +2035,7 @@ around `scroll-down-command' (which see)."
 ;;; Value
 ;;;; Core
 
-(defun transient-args (&optional prefix separate)
+(defun transient-args (&optional prefix)
   "Return the value of the transient from which the current suffix was called.
 
 If optional PREFIX is non-nil, then it should be a symbol, a
@@ -2043,33 +2043,14 @@ transient prefix command.  In that case only return the 
value
 of the transient if the suffix was actually invoked from that
 transient.  Otherwise return nil.  This function is also used
 internally, in which PREFIX can also be a `transient-prefix'
-object.
-
-If optional SEPARATE is non-nil, then separate the arguments
-into two groups.  If SEPARATE is t, then separate into atoms
-and conses (nil isn't a valid value, so it doesn't matter that
-that is both an atom and a cons).
-
-SEPARATE can also be a predicate function, in which case the
-first element is a list of the values for which it returns
-non-nil and the second a list of the values for which it
-returns nil.
-
-For transients that are used to pass arguments to a subprosess
-\(such as git), `stringp' is a useful value for SEPARATE, it
-separates non-positional arguments from positional arguments.
-The value of Magit's file argument for example looks like this:
-\(\"--\" file...)."
-  (let ((val (if (transient-prefix--eieio-childp prefix)
-                 (delq nil (mapcar 'transient-infix-value
-                                   transient--suffixes))
-               (and (or (not prefix)
-                        (eq prefix current-transient-command))
-                    (delq nil (mapcar 'transient-infix-value
-                                      current-transient-suffixes))))))
-    (if separate
-        (-separate (if (eq separate t) #'atom separate) val)
-      val)))
+object."
+  (if (transient-prefix--eieio-childp prefix)
+      (delq nil (mapcar 'transient-infix-value
+                        transient--suffixes))
+    (and (or (not prefix)
+             (eq prefix current-transient-command))
+         (delq nil (mapcar 'transient-infix-value
+                           current-transient-suffixes)))))
 
 ;;;; Init
 



reply via email to

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