[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient ebe9d9d354 046/366: transient-{set, save}-val
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient ebe9d9d354 046/366: transient-{set, save}-value: New generic functions |
Date: |
Tue, 25 Jan 2022 18:54:25 -0500 (EST) |
branch: externals/transient
commit ebe9d9d3545e6e2552cfa4279fedb6ccbd9dd4cb
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
transient-{set,save}-value: New generic functions
---
lisp/transient.el | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/lisp/transient.el b/lisp/transient.el
index c441903ecc..10787e13ee 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -1825,17 +1825,12 @@ transient is active."
(defun transient-set ()
"Save the value of the active transient for this Emacs session."
(interactive)
- (oset (oref transient--prefix prototype) value (transient-args))
- (transient--history-push))
+ (transient-set-value transient--prefix))
(defun transient-save ()
"Save the value of the active transient persistenly across Emacs sessions."
(interactive)
- (let ((value (transient-args)))
- (oset (oref transient--prefix prototype) value value)
- (setf (alist-get (oref transient--prefix command) transient-values) value)
- (transient-save-values))
- (transient--history-push))
+ (transient-save-value transient--prefix))
(defun transient-history-next ()
"Switch to the next value used for the active transient."
@@ -2175,6 +2170,19 @@ This implementation should be suitable for almost all
infix
commands. It simply calls `oset'."
(oset obj value value))
+(cl-defmethod transient-set-value ((obj transient-prefix))
+ (oset (oref obj prototype) value (transient-args))
+ (transient--history-push))
+
+;;;; Save
+
+(cl-defmethod transient-save-value ((obj transient-prefix))
+ (let ((value (transient-args)))
+ (oset (oref obj prototype) value value)
+ (setf (alist-get (oref obj command) transient-values) value)
+ (transient-save-values))
+ (transient--history-push))
+
;;;; Use
(cl-defgeneric transient-infix-value (obj)
- [elpa] externals/transient 2f011c9f19 013/366: transient--show-brief: Don't call kbd twice per key, (continued)
- [elpa] externals/transient 2f011c9f19 013/366: transient--show-brief: Don't call kbd twice per key, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient db815604b3 025/366: Mention that infixes are suffixes, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient cc54574005 017/366: manual: Prevent evaluation of code blocks, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 328298fb7d 021/366: transient--pp-to-file: New function, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 796f896507 026/366: Add a changelog, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 1fa3896986 016/366: manual: Call ox-texinfo+-update-copyright-years while exporting, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient f0213e0543 032/366: Add commands to scroll transient window, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 2fed1b4f90 036/366: Change transient-show's key binding, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 6a9b8a6bd4 037/366: Bind transient-scroll-{up, down} explicitly, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 5f0ec7d08c 039/366: transient-predicate-map: Bind digit-argument, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient ebe9d9d354 046/366: transient-{set, save}-value: New generic functions,
Jonas Bernoulli <=
- [elpa] externals/transient eade425ec6 044/366: transient-init-value: Define catch all method using cl-defgeneric, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 93c9a7ecfc 052/366: transient--history-init: Fix doc-string pasto, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient f2314ba2a4 059/366: transient-infix-set: Silence byte-compiler, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 1c6afb817f 061/366: Teach the mode-related suffix predicates about lists of modes, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 6506cfdb8b 062/366: define-transient-command: Support :level in suffix definitions, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient a87cb2c35a 063/366: transient-read-directory: New function, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 1e8dfe954a 070/366: transient--window: Add doc-string, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 99d3bf6e76 014/366: transient--show-brief: Don't show binding for transient-set-level, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 170a3fd791 005/366: make: Don't try to build removed transient-demo.el, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 33e96045b4 009/366: transient-substitute-key-function: Drop repeated wording, Jonas Bernoulli, 2022/01/25