[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient 37307c1b8c 05/26: transient-prefix-object: Ne
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient 37307c1b8c 05/26: transient-prefix-object: New function |
Date: |
Sun, 26 Nov 2023 19:41:58 -0500 (EST) |
branch: externals/transient
commit 37307c1b8c8dfbe1069465296cd811f3290d97f8
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
transient-prefix-object: New function
---
lisp/transient.el | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/lisp/transient.el b/lisp/transient.el
index c87689eeba..3c735700ad 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -1467,6 +1467,31 @@ This is bound while the suffixes are drawn in the
transient buffer.")
;;; Identities
+(defun transient-prefix-object ()
+ "Return the current prefix as an object.
+
+While a transient is being setup or refreshed (which involves
+preparing its suffixes) the variable `transient--prefix' can be
+used to access the prefix object. Thus this is what has to be
+used in suffix methods such as `transient-format-description',
+and in object-specific functions that are stored in suffix slots
+such as `description'.
+
+When a suffix command is invoked (i.e., in its `interactive' form
+and function body) then the variable `transient-current-prefix'
+has to be used instead.
+
+Two distinct variables are needed, because any prefix may itself
+be used as a suffix of another prefix, and such sub-prefixes have
+to be able to tell themselves apart from the prefix they were
+invoked from.
+
+Regular suffix commands, which are not prefixes, do not have to
+concern themselves with this distinction, so they can use this
+function instead. In the context of a plain suffix, it always
+returns the value of the appropiate variable."
+ (or transient--prefix transient-current-prefix))
+
(defun transient-suffix-object (&optional command)
"Return the object associated with the current suffix command.
- [elpa] externals/transient updated (57bb749f98 -> af6eb31054), Jonas Bernoulli, 2023/11/26
- [elpa] externals/transient 7d9d639cdf 01/26: make: Only append newline to transient.texi if missing, Jonas Bernoulli, 2023/11/26
- [elpa] externals/transient ff496fe5ad 04/26: manual: Use "documentation string" instead of "doc string", Jonas Bernoulli, 2023/11/26
- [elpa] externals/transient 44792c2bf9 03/26: manual: Copy-edit, Jonas Bernoulli, 2023/11/26
- [elpa] externals/transient 163d0a83f7 02/26: manual: Regenerate texi file, Jonas Bernoulli, 2023/11/26
- [elpa] externals/transient 004ca25946 06/26: Move definition of functions that handle pre-commands, Jonas Bernoulli, 2023/11/26
- [elpa] externals/transient f23f51e24e 07/26: Rename transient--{do => call}-pre-command, Jonas Bernoulli, 2023/11/26
- [elpa] externals/transient 37307c1b8c 05/26: transient-prefix-object: New function,
Jonas Bernoulli <=
- [elpa] externals/transient 4c1cda9984 08/26: Rename transient-get-{predicate-for => pre-command}, Jonas Bernoulli, 2023/11/26
- [elpa] externals/transient f4b4dd42b9 14/26: Add transient--do-leave's missing color setting, Jonas Bernoulli, 2023/11/26
- [elpa] externals/transient 0509c90e53 11/26: transient--key-face: New function, Jonas Bernoulli, 2023/11/26
- [elpa] externals/transient 05754d1576 13/26: Rearrange pre-command color settings, Jonas Bernoulli, 2023/11/26
- [elpa] externals/transient 98d8cf8016 15/26: Fix transient--do-quit-one's color setting, Jonas Bernoulli, 2023/11/26
- [elpa] externals/transient 9c00fae158 10/26: transient--add-face: Move definition, Jonas Bernoulli, 2023/11/26
- [elpa] externals/transient b1951a87b5 09/26: transient--resolve-pre-command: Optionally resolve boolean as well, Jonas Bernoulli, 2023/11/26
- [elpa] externals/transient 9a21467706 12/26: transient--separator-line: New function, Jonas Bernoulli, 2023/11/26
- [elpa] externals/transient 47d3f01d9f 17/26: Fix/improve some faces, Jonas Bernoulli, 2023/11/26
- [elpa] externals/transient ad7a098349 16/26: Rearrange face definitions, Jonas Bernoulli, 2023/11/26