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

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

[elpa] externals/transient 1b9929eca9 197/366: Add new `unsavable' infix


From: Jonas Bernoulli
Subject: [elpa] externals/transient 1b9929eca9 197/366: Add new `unsavable' infix slot
Date: Tue, 25 Jan 2022 18:54:40 -0500 (EST)

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

    Add new `unsavable' infix slot
    
    If this is non-nil, then the value of the infix is removed from
    the prefix value before saving, setting and adding to history.
    
    Re #96.
---
 docs/transient.org  | 7 +++++--
 docs/transient.texi | 9 +++++++--
 lisp/transient.el   | 7 ++++++-
 3 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/docs/transient.org b/docs/transient.org
index 01486a150b..d7736b5bd0 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-44-gf0f3e2b9+1)
+#+SUBTITLE: for version 0.2.0 (v0.2.0-45-g313eee0f+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-44-gf0f3e2b9+1).
+This manual is for Transient version 0.2.0 (v0.2.0-45-g313eee0f+1).
 
 #+BEGIN_QUOTE
 Copyright (C) 2018-2020 Jonas Bernoulli <jonas@bernoul.li>
@@ -1593,6 +1593,9 @@ They are defined here anyway to allow sharing certain 
methods.
 
 - ~value~ The value.  Should not be accessed directly.
 
+- ~unsavable~ Whether the value of the suffix is not saved as part of
+  the prefixes.
+
 - ~multi-value~ For options, whether the option can have multiple
   values.  If non-nil, then default to use ~completing-read-multiple~.
 
diff --git a/docs/transient.texi b/docs/transient.texi
index a45d2b5da0..b692001b69 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-44-gf0f3e2b9+1)
+@subtitle for version 0.2.0 (v0.2.0-45-g313eee0f+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-44-gf0f3e2b9+1).
+This manual is for Transient version 0.2.0 (v0.2.0-45-g313eee0f+1).
 
 @quotation
 Copyright (C) 2018-2020 Jonas Bernoulli <jonas@@bernoul.li>
@@ -1973,6 +1973,11 @@ They are defined here anyway to allow sharing certain 
methods.
 @code{value} The value.  Should not be accessed directly.
 
 
+@item
+@code{unsavable} Whether the value of the suffix is not saved as part of
+the prefixes.
+
+
 @item
 @code{multi-value} For options, whether the option can have multiple
 values.  If non-nil, then default to use @code{completing-read-multiple}.
diff --git a/lisp/transient.el b/lisp/transient.el
index f676e17ac2..a5959286b3 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -650,6 +650,7 @@ slot is non-nil."
    (argument    :initarg :argument)
    (shortarg    :initarg :shortarg)
    (value                             :initform nil)
+   (unsavable   :initarg :unsavable   :initform nil)
    (multi-value :initarg :multi-value :initform nil)
    (always-read :initarg :always-read :initform nil)
    (allow-empty :initarg :allow-empty :initform nil)
@@ -2598,7 +2599,11 @@ the set, saved or default value for PREFIX."
       (delq nil (mapcar 'transient-infix-value transient--suffixes)))))
 
 (defun transient-get-value ()
-  (delq nil (mapcar 'transient-infix-value transient-current-suffixes)))
+  (delq nil (mapcar (lambda (obj)
+                      (and (or (not (slot-exists-p obj 'unsavable))
+                               (not (oref obj unsavable)))
+                           (transient-infix-value obj)))
+                    transient-current-suffixes)))
 
 (cl-defgeneric transient-infix-value (obj)
   "Return the value of the suffix object OBJ.



reply via email to

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