[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient 94661e0ccd 34/41: transient--do-replace: Repl
|
From: |
Jonas Bernoulli |
|
Subject: |
[elpa] externals/transient 94661e0ccd 34/41: transient--do-replace: Replace with two variants |
|
Date: |
Sun, 12 Nov 2023 20:04:09 -0500 (EST) |
branch: externals/transient
commit 94661e0ccd5471f190022d34e76f600c46eb8b88
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
transient--do-replace: Replace with two variants
Rename the existing `transient--do-replace' to `transient--do-stack',
because that's what it really does.
Repurpose the name `transient--do-replace' for a new variants that
actually replaces the active transient, i.e., which does not place
the active transient on the stack, but replaces it completely.
Changing what `transient--do-replace' does, shouldn't be a problem
because in definitions of individual transient prefix commands and
their sub-prefixes, this pre-command should never have been used
by name anyway.
---
docs/transient.org | 12 +++++++++++-
docs/transient.texi | 12 +++++++++++-
lisp/transient.el | 21 +++++++++++++++------
3 files changed, 37 insertions(+), 8 deletions(-)
diff --git a/docs/transient.org b/docs/transient.org
index e8b5a6cbde..615adbbcab 100644
--- a/docs/transient.org
+++ b/docs/transient.org
@@ -1380,15 +1380,25 @@ slot for the sub-prefix itself.
Whether we actually return to the parent transient is ultimately
under the control of each invoked suffix. The difference between
- this pre-command and ~transient--do-replace~ is that it changes the
+ this pre-command and ~transient--do-stack~ is that it changes the
value of the ~transient-suffix~ slot to ~t~.
If there is no parent transient, then only call this command and
skip the second step.
+- Function: transient--do-stack ::
+
+ Call the transient prefix command, stacking the active transient.
+ Push the active transient to the transient stack.
+
+ Unless ~transient--do-recurse~ is explicitly used, this pre-command
+ is automatically used for suffixes that are prefixes themselves,
+ i.e., for sub-prefixes.
+
- Function: transient--do-replace ::
Call the transient prefix command, replacing the active transient.
+ Do not push the active transient to the transient stack.
Unless ~transient--do-recurse~ is explicitly used, this pre-command
is automatically used for suffixes that are prefixes themselves,
diff --git a/docs/transient.texi b/docs/transient.texi
index a8d1ab2b1e..9c4730fd4d 100644
--- a/docs/transient.texi
+++ b/docs/transient.texi
@@ -1572,15 +1572,25 @@ transient.
Whether we actually return to the parent transient is ultimately
under the control of each invoked suffix. The difference between
-this pre-command and @code{transient--do-replace} is that it changes the
+this pre-command and @code{transient--do-stack} is that it changes the
value of the @code{transient-suffix} slot to @code{t}.
If there is no parent transient, then only call this command and
skip the second step.
@end defun
+@defun transient--do-stack
+Call the transient prefix command, stacking the active transient.
+Push the active transient to the transient stack.
+
+Unless @code{transient--do-recurse} is explicitly used, this pre-command
+is automatically used for suffixes that are prefixes themselves,
+i.e., for sub-prefixes.
+@end defun
+
@defun transient--do-replace
Call the transient prefix command, replacing the active transient.
+Do not push the active transient to the transient stack.
Unless @code{transient--do-recurse} is explicitly used, this pre-command
is automatically used for suffixes that are prefixes themselves,
diff --git a/lisp/transient.el b/lisp/transient.el
index fb4dec1850..2b81822baf 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -1779,7 +1779,7 @@ of the corresponding object."
(define-key map (vector cmd)
(pcase (list kind (oref obj transient) return)
(`(prefix t ,_) #'transient--do-recurse)
- (`(prefix nil ,_) #'transient--do-replace)
+ (`(prefix nil ,_) #'transient--do-stack)
(`(infix t ,_) #'transient--do-stay)
(`(suffix t ,_) #'transient--do-call)
('(suffix nil t) #'transient--do-return)
@@ -1791,7 +1791,7 @@ of the corresponding object."
(`(prefix ,(or 'transient--do-stay 'transient--do-call) ,_)
#'transient--do-recurse)
(`(prefix t ,_) #'transient--do-recurse)
- (`(prefix ,_ ,_) #'transient--do-replace)
+ (`(prefix ,_ ,_) #'transient--do-stack)
(`(infix ,_ ,_) #'transient--do-stay)
(`(suffix t ,_) #'transient--do-call)
('(suffix nil t) #'transient--do-return)
@@ -1856,7 +1856,7 @@ EDIT may be non-nil."
(setq params (list :scope (oref transient--prefix scope))))
(transient--prefix
;; Invoked as a ":transient-non-suffix 'transient--do-{stay,call}"
- ;; of an outer prefix. Unlike the usual `transient--do-replace',
+ ;; of an outer prefix. Unlike the usual `transient--do-stack',
;; these predicates fail to clean up after the outer prefix.
(transient--pop-keymap 'transient--transient-map)
(transient--pop-keymap 'transient--redisplay-map))
@@ -2546,7 +2546,7 @@ Use that command's pre-command to determine transient
behavior."
(defun transient--do-recurse ()
"Call the transient prefix command, preparing for return to active transient.
If there is no parent prefix, then just call the command."
- (transient--do-replace))
+ (transient--do-stack))
(defun transient--setup-recursion (prefix-obj)
(when transient--stack
@@ -2558,13 +2558,21 @@ If there is no parent prefix, then just call the
command."
(list t #'transient--do-recurse))
(oset prefix-obj transient-suffix t))))))
-(defun transient--do-replace ()
- "Call the transient prefix command, replacing the active transient."
+(defun transient--do-stack ()
+ "Call the transient prefix command, stacking the active transient.
+Push the active transient to the transient stack."
(transient--export)
(transient--stack-push)
(setq transient--exitp 'replace)
transient--exit)
+(defun transient--do-replace ()
+ "Call the transient prefix command, replacing the active transient.
+Do not push the active transient to the transient stack."
+ (transient--export)
+ (setq transient--exitp 'replace)
+ transient--exit)
+
(defun transient--do-suspend ()
"Suspend the active transient, saving the transient stack."
(transient--stack-push)
@@ -2614,6 +2622,7 @@ prefix argument and pivot to `transient-update'."
(put 'transient--do-exit 'transient-color 'transient-blue)
(put 'transient--do-recurse 'transient-color 'transient-red)
(put 'transient--do-replace 'transient-color 'transient-blue)
+(put 'transient--do-stack 'transient-color 'transient-red)
(put 'transient--do-suspend 'transient-color 'transient-blue)
(put 'transient--do-quit-one 'transient-color 'transient-blue)
(put 'transient--do-quit-all 'transient-color 'transient-blue)
- [elpa] externals/transient 9d9e931996 25/41: transient--shadowed-buffer: Renamed from transient--current-buffer, (continued)
- [elpa] externals/transient 9d9e931996 25/41: transient--shadowed-buffer: Renamed from transient--current-buffer, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 8e15a29b59 31/41: transient-format-description: Support function as value of face slot, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 533578b6b2 32/41: transient-information: Use a space as the fake key, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 59d8c0342a 18/41: transient--unset-incompatible: Remove unnecessary variable, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient ed5bd6fdc3 23/41: transient-infix-set(argument): Fix disabling incompatible options, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient bad91f79ec 29/41: transient-with-shadowed-buffer: Move definition, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient cf32cf6f98 39/41: transient--get-face: Favor face over function, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 4b9d831d28 10/41: transient--make-predicate-map: Drop obsolete condition, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 784887b781 14/41: Account for t as transient-suffix for nested prefixes, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 2eb214a6ec 24/41: transient-infix-set(argument): Also disable based on concrete value, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 94661e0ccd 34/41: transient--do-replace: Replace with two variants,
Jonas Bernoulli <=
- [elpa] externals/transient 9617b6c77c 35/41: transient--make-predicate-map: Support shorthands, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 3a2b936a67 36/41: Fix highlighting infix for which user input is being read, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 222c2bfbeb 38/41: transient--get-face: New function, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 02607dd9d9 04/41: manual: Move comparisons to wiki, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 0677e2c3d8 26/41: transient-format-description: Operate in transient--shadowed-buffer, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient b4a2963636 33/41: transient-format(around:suffix): Update for transient-information, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient d44c4fce39 40/41: transient--get-face: Use for inapt-face, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient eaf062a921 11/41: transient--make-predicate-map: Refactor, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 5ad5b627f6 15/41: transient--setup-recursion: When initiated by outer transient-suffix, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 2b7219cf6a 28/41: transient--current-buffer: Fix obsolete variable alias, Jonas Bernoulli, 2023/11/12