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

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

[elpa] externals/transient a35177475c 200/366: transient-suffixes: New f


From: Jonas Bernoulli
Subject: [elpa] externals/transient a35177475c 200/366: transient-suffixes: New function
Date: Tue, 25 Jan 2022 18:54:40 -0500 (EST)

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

    transient-suffixes: New function
    
    Closes #98.
---
 docs/transient.org  | 11 +++++++++--
 docs/transient.texi | 12 ++++++++++--
 lisp/transient.el   |  8 ++++++--
 3 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/docs/transient.org b/docs/transient.org
index 2e118d4359..0cc4c95e43 100644
--- a/docs/transient.org
+++ b/docs/transient.org
@@ -8,7 +8,7 @@
 #+TEXINFO_DIR_CATEGORY: Emacs
 #+TEXINFO_DIR_TITLE: Transient: (transient).
 #+TEXINFO_DIR_DESC: Transient Commands
-#+SUBTITLE: for version 0.2.0 (v0.2.0-47-gd1caef51+1)
+#+SUBTITLE: for version 0.2.0 (v0.2.0-48-g8423bc69+1)
 
 #+TEXINFO_DEFFN: t
 #+OPTIONS: H:4 num:4 toc:2
@@ -37,7 +37,7 @@ Calling a suffix command usually causes the transient to be 
exited
 but suffix commands can also be configured to not exit the transient.
 
 #+TEXINFO: @noindent
-This manual is for Transient version 0.2.0 (v0.2.0-47-gd1caef51+1).
+This manual is for Transient version 0.2.0 (v0.2.0-48-g8423bc69+1).
 
 #+BEGIN_QUOTE
 Copyright (C) 2018-2020 Jonas Bernoulli <jonas@bernoul.li>
@@ -1036,6 +1036,13 @@ function, which for infix arguments serves about the 
same purpose as
   command was not invoked from PREFIX, then it returns the set, saved
   or default value for PREFIX.
 
+- Function: transient-suffixes prefix
+
+  This function returns the suffixes of the transient prefix command
+  PREFIX.  This is a list of objects.  This function should only be
+  used if you need the objects (as opposed to just their values) and
+  if the current command is not being invoked from PREFIX.
+
 - Variable: transient-current-suffixes
 
   The suffixes of the transient from which this suffix command was
diff --git a/docs/transient.texi b/docs/transient.texi
index ae8e5637ea..66a347da88 100644
--- a/docs/transient.texi
+++ b/docs/transient.texi
@@ -31,7 +31,7 @@ General Public License for more details.
 @finalout
 @titlepage
 @title Transient User and Developer Manual
-@subtitle for version 0.2.0 (v0.2.0-47-gd1caef51+1)
+@subtitle for version 0.2.0 (v0.2.0-48-g8423bc69+1)
 @author Jonas Bernoulli
 @page
 @vskip 0pt plus 1filll
@@ -65,7 +65,7 @@ Calling a suffix command usually causes the transient to be 
exited
 but suffix commands can also be configured to not exit the transient.
 
 @noindent
-This manual is for Transient version 0.2.0 (v0.2.0-47-gd1caef51+1).
+This manual is for Transient version 0.2.0 (v0.2.0-48-g8423bc69+1).
 
 @quotation
 Copyright (C) 2018-2020 Jonas Bernoulli <jonas@@bernoul.li>
@@ -1286,6 +1286,14 @@ command was not invoked from PREFIX, then it returns the 
set, saved
 or default value for PREFIX@.
 @end defun
 
+@defun transient-suffixes prefix
+
+This function returns the suffixes of the transient prefix command
+PREFIX@.  This is a list of objects.  This function should only be
+used if you need the objects (as opposed to just their values) and
+if the current command is not being invoked from PREFIX@.
+@end defun
+
 @defvar transient-current-suffixes
 
 The suffixes of the transient from which this suffix command was
diff --git a/lisp/transient.el b/lisp/transient.el
index 63dc78f538..ff3c3ec978 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -2598,13 +2598,17 @@ 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."
+  (delq nil (mapcar 'transient-infix-value (transient-suffixes prefix))))
+
+(defun transient-suffixes (prefix)
+  "Return the suffix objects of the transient prefix command PREFIX."
   (if (eq transient-current-command prefix)
-      (delq nil (mapcar 'transient-infix-value transient-current-suffixes))
+      transient-current-suffixes
     (let ((transient--prefix nil)
           (transient--layout nil)
           (transient--suffixes nil))
       (transient--init-objects prefix nil nil)
-      (delq nil (mapcar 'transient-infix-value transient--suffixes)))))
+      transient--suffixes)))
 
 (defun transient-get-value ()
   (delq nil (mapcar (lambda (obj)



reply via email to

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