[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient d0cba152dc 06/25: transient-scope: Add PREFIX
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient d0cba152dc 06/25: transient-scope: Add PREFIX argument |
Date: |
Tue, 3 Dec 2024 14:35:01 -0500 (EST) |
branch: externals/transient
commit d0cba152dc708b1cf9028539ac5204469057027b
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
transient-scope: Add PREFIX argument
---
CHANGELOG | 3 +++
lisp/transient.el | 20 +++++++++++++++++---
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index 8db0f34b07..575580edc0 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -6,6 +6,9 @@
- Added documentation for ~inapt-if*~ slots to manual. 179545a6
+- ~transient-args~ and ~transient-scope~ now both take a prefix command or
+ a list of prefix commands as argument.
+
Bug fixes:
- Fixes some menu navigation edge-cases.
diff --git a/lisp/transient.el b/lisp/transient.el
index 87b83dcaf8..4d6a841df9 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -3664,9 +3664,23 @@ implementation, which is a noop.")
;;;; Get
-(defun transient-scope ()
- "Return the value of the `scope' slot of the current prefix."
- (oref (transient-prefix-object) scope))
+(defun transient-scope (&optional prefix)
+ "Return the value of the `scope' slot of the current prefix.
+
+If the current command wasn't invoked from a prefix, return nil.
+
+If PREFIX is non-nil, it must a single prefix or a list of prefixes.
+If the current prefix is one of these prefixes, return its scope,
+otherwise return nil.
+
+If PREFIX is nil (for backward compatibility it may also be omitted)
+then return the scope of the current prefix, whatever that is. This
+usage is rarely appropriate; it is better to be explicit."
+ (declare (advertised-calling-convention (prefix) "0.8.0"))
+ (and transient-current-command
+ (or (not prefix)
+ (memq transient-current-command (ensure-list prefix)))
+ (oref (transient-prefix-object) scope)))
;;; History
- [elpa] externals/transient c93c35f567 13/25: transient--show: Fix window height for more setups, (continued)
- [elpa] externals/transient c93c35f567 13/25: transient--show: Fix window height for more setups, Jonas Bernoulli, 2024/12/03
- [elpa] externals/transient aaefee0d01 03/25: Remove comments mentioning a legacy Emacs bug, Jonas Bernoulli, 2024/12/03
- [elpa] externals/transient 3b28a2f8d6 12/25: transient-hide-during-minibuffer-read: Change default to t, Jonas Bernoulli, 2024/12/03
- [elpa] externals/transient 3539231b98 20/25: fixup(e3e2e111): Improve options for showing menu during minibuffer use, Jonas Bernoulli, 2024/12/03
- [elpa] externals/transient 645f1b2cd4 25/25: transient--stack-push: Preserve the value, Jonas Bernoulli, 2024/12/03
- [elpa] externals/transient d64b73efbc 17/25: transient-scope: Return nil if all prefixes are nil, Jonas Bernoulli, 2024/12/03
- [elpa] externals/transient ecdee415fb 16/25: transient-scope: Fully revert behavior with no argument, Jonas Bernoulli, 2024/12/03
- [elpa] externals/transient b3f3aa034a 09/25: transient-init-value: Define noop method for transient-suffix, Jonas Bernoulli, 2024/12/03
- [elpa] externals/transient 4130f62966 11/25: transient--show: Run transient-setup-buffer-hook later, Jonas Bernoulli, 2024/12/03
- [elpa] externals/transient 24a1be509b 02/25: docs: Fix word order, Jonas Bernoulli, 2024/12/03
- [elpa] externals/transient d0cba152dc 06/25: transient-scope: Add PREFIX argument,
Jonas Bernoulli <=
- [elpa] externals/transient 75f0aef8d7 04/25: Add new "Scope" top-level section, Jonas Bernoulli, 2024/12/03
- [elpa] externals/transient 9259f77e14 05/25: transient-args: Allow PREFIX to be a list of prefixes, Jonas Bernoulli, 2024/12/03
- [elpa] externals/transient 6b83a02151 08/25: transient-init-scope: Add stub method for prefixes, Jonas Bernoulli, 2024/12/03
- [elpa] externals/transient 37be15575a 23/25: fixup(e3e2e111): Improve options for showing menu during minibuffer use, Jonas Bernoulli, 2024/12/03
- [elpa] externals/transient 4de5812992 15/25: transient-scope: Fix recent regression, Jonas Bernoulli, 2024/12/03
- [elpa] externals/transient 51f25c21b8 24/25: Fix typos in documentation, Jonas Bernoulli, 2024/12/03
- [elpa] externals/transient cb5e1e5594 18/25: transient-scope: Redesign, Jonas Bernoulli, 2024/12/03
- [elpa] externals/transient 23cb5b109d 22/25: transient-prefix: Add mode-line-format slot, Jonas Bernoulli, 2024/12/03
- [elpa] externals/transient e3e2e1112f 19/25: Improve options for showing menu during minibuffer use, Jonas Bernoulli, 2024/12/03
- [elpa] externals/transient 7e50a8fa8e 14/25: Check validity of transient-display-buffer-action, Jonas Bernoulli, 2024/12/03