[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient d33fe5abaf 101/366: Split new transient-get-v
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient d33fe5abaf 101/366: Split new transient-get-value from transient-args |
Date: |
Tue, 25 Jan 2022 18:54:31 -0500 (EST) |
branch: externals/transient
commit d33fe5abaf5d0de2a8e80e7e52555d725ebdc6e5
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Split new transient-get-value from transient-args
Going forward `transient-args' is only intended for use by regular
suffix commands that consume the arguments.
The new `transient-get-value' is intended primarily for indirect use
by special suffix commands that set or save the value. More precisely
by the methods `transient-set-value' and `transient-save-value', which
are used by the commands `transient-set' and `transient-save' (as well
as by the internal `transient--history-push').
---
docs/transient.org | 9 ---------
lisp/transient.el | 29 +++++++++++------------------
2 files changed, 11 insertions(+), 27 deletions(-)
diff --git a/docs/transient.org b/docs/transient.org
index b22710725a..a834d00bc9 100644
--- a/docs/transient.org
+++ b/docs/transient.org
@@ -1002,15 +1002,6 @@ function, which for infix arguments serves about the
same purpose as
- 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
- called from a transient, then it returns ~nil~.
-
- If optional PREFIX is non-~nil~, then it should be a symbol, a
- transient prefix command. In that case the value of the transient
- is only returned if the suffix was invoked from *that* transient.
- Otherwise ~nil~ is returned.
-
- 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 152397239a..39cb7874ac 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -2033,20 +2033,6 @@ around `scroll-down-command' (which see)."
(message "No suspended transient command"))))
;;; Value
-;;;; Core
-
-(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
-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."
- (and (or (not prefix)
- (eq prefix current-transient-command))
- (delq nil (mapcar 'transient-infix-value
- current-transient-suffixes))))
-
;;;; Init
(cl-defgeneric transient-init-scope (obj)
@@ -2319,19 +2305,26 @@ commands."
(cl-call-next-method obj value))))
(cl-defmethod transient-set-value ((obj transient-prefix))
- (oset (oref obj prototype) value (transient-args))
+ (oset (oref obj prototype) value (transient-get-value))
(transient--history-push obj))
;;;; Save
(cl-defmethod transient-save-value ((obj transient-prefix))
- (let ((value (transient-args)))
+ (let ((value (transient-get-value)))
(oset (oref obj prototype) value value)
(setf (alist-get (oref obj command) transient-values) value)
(transient-save-values))
(transient--history-push obj))
-;;;; Use
+;;;; Get
+
+(defun transient-args (prefix)
+ (and (eq current-transient-command prefix)
+ (delq nil (mapcar 'transient-infix-value current-transient-suffixes))))
+
+(defun transient-get-value ()
+ (delq nil (mapcar 'transient-infix-value current-transient-suffixes)))
(cl-defgeneric transient-infix-value (obj)
"Return the value of the suffix object OBJ.
@@ -2401,7 +2394,7 @@ that. Otherwise return the value of the `command' slot."
"Push the current value of OBJ to its entry in `transient-history'."
(let ((key (transient--history-key obj)))
(setf (alist-get key transient-history)
- (let ((args (transient-args)))
+ (let ((args (transient-get-value)))
(cons args (delete args (alist-get key transient-history)))))))
(cl-defgeneric transient--history-init (obj)
- [elpa] externals/transient 9ca983bab2 238/366: Release version 0.3.0, (continued)
- [elpa] externals/transient 9ca983bab2 238/366: Release version 0.3.0, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient eff65f1d85 243/366: Revert "manual: Deal with texinfo cross reference idiocy", Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient ed4809afb8 255/366: make: Set VERSION, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 1e74060854 270/366: transient-map: Bind C-u to universal-argument, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient f5e600d3f4 284/366: transient-init-value: Fix typo in doc-strings, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient ed992c58cd 094/366: Properly handle existing string pseudo suffixes, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 2eff8d57e8 096/366: Add .github/FUNDING.yml, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 01a166fcb8 097/366: Declare variable alias before its referent, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 8232a0aaa2 098/366: manual: Do not require unused magit-utils and org-man, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 68f31ed34f 104/366: manual: Fix broken export rendering by org mistaking `=' for markup, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient d33fe5abaf 101/366: Split new transient-get-value from transient-args,
Jonas Bernoulli <=
- [elpa] externals/transient 7bf97594a5 110/366: transient-infix-read: Bugfix, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 79a72db95f 117/366: Fix typos, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 89e6941a85 111/366: transient-undefined: Make some noise, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 617844abe5 121/366: transient-undefined: Also show the command, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient a1525bb992 124/366: transient--emergency-exit: Improve doc-string, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient ff78eddcbf 126/366: Fix indentation, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 970563c54a 129/366: Put transient in extensions custom group, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient c1ae1eecdd 130/366: transient-separator: Extend to window edge in Emacs 27 too, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 81c0772c19 139/366: transient-infix-read: Remove ivy-index property from history element, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 8d31993c62 146/366: manual: Remove some trigger words from LocalWords, Jonas Bernoulli, 2022/01/25