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

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

[elpa] externals/transient dcf7a4dc62 084/366: transient-read-with-initi


From: Jonas Bernoulli
Subject: [elpa] externals/transient dcf7a4dc62 084/366: transient-read-with-initial-input: New option
Date: Tue, 25 Jan 2022 18:54:29 -0500 (EST)

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

    transient-read-with-initial-input: New option
    
    Closes #46.
---
 docs/transient.org  | 11 +++++++++--
 docs/transient.texi | 12 ++++++++++--
 lisp/transient.el   |  9 ++++++++-
 3 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/docs/transient.org b/docs/transient.org
index 6c475cce77..9ba6c2eb8e 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.1.0 (v0.1.0-75-ge7a16d2+1)
+#+SUBTITLE: for version 0.1.0 (v0.1.0-82-gf0a7a97+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.1.0 (v0.1.0-75-ge7a16d2+1).
+This manual is for Transient version 0.1.0 (v0.1.0-82-gf0a7a97+1).
 
 #+BEGIN_QUOTE
 Copyright (C) 2018-2019 Jonas Bernoulli <jonas@bernoul.li>
@@ -553,6 +553,13 @@ window, and the key bindings are the same as for 
~scroll-up-command~ and
   Otherwise this can be any mode-line format.  See ~[[info:elisp#Mode
   Line Format]] for details.
 
+- User Option: transient-read-with~initial-input
+
+  This option controls whether the last history element is used as the
+  initial minibuffer input when reading the value of an infix argument
+  from the user.  If ~nil~, then there is no initial input and the first
+  element has to be accessed the same way as the older elements.
+
 - User Option: transient-highlight-mismatched-keys
 
   This option controls whether key bindings of infix commands that do
diff --git a/docs/transient.texi b/docs/transient.texi
index c715e02051..eb1a75ce4c 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.1.0 (v0.1.0-75-ge7a16d2+1)
+@subtitle for version 0.1.0 (v0.1.0-82-gf0a7a97+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.1.0 (v0.1.0-75-ge7a16d2+1).
+This manual is for Transient version 0.1.0 (v0.1.0-82-gf0a7a97+1).
 
 @quotation
 Copyright (C) 2018-2019 Jonas Bernoulli <jonas@@bernoul.li>
@@ -740,6 +740,14 @@ thin line is drawn instead, using the background color of 
the face
 Otherwise this can be any mode-line format.  See ~@ref{Mode Line 
Format,,,elisp,} for details.
 @end defopt
 
+@defopt transient-read-with~initial-input
+
+This option controls whether the last history element is used as the
+initial minibuffer input when reading the value of an infix argument
+from the user.  If @code{nil}, then there is no initial input and the first
+element has to be accessed the same way as the older elements.
+@end defopt
+
 @defopt transient-highlight-mismatched-keys
 
 This option controls whether key bindings of infix commands that do
diff --git a/lisp/transient.el b/lisp/transient.el
index 74a7826b90..7937cc065e 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -173,6 +173,12 @@ of this variable use \"C-x t\" when a transient is active."
   :group 'transient
   :type 'boolean)
 
+(defcustom transient-read-with-initial-input t
+  "Whether to use the last history element as initial minibuffer input."
+  :package-version '(transient . "0.2.0")
+  :group 'transient
+  :type 'boolean)
+
 (defcustom transient-highlight-mismatched-keys nil
   "Whether to highlight keys that do not match their argument.
 
@@ -2145,7 +2151,8 @@ it\", in which case it is pointless to preserve history.)"
                                          (eq value (car transient--history)))
                                      transient--history
                                    (cons value transient--history)))
-             (initial-input (car transient--history))
+             (initial-input (and transient-read-with-initial-input
+                                 (car transient--history)))
              (history (cons 'transient--history (if initial-input 1 0)))
              (value
               (cond



reply via email to

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