[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient 03e752d977 8/9: transient-parse-{suffix, suff
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient 03e752d977 8/9: transient-parse-{suffix, suffixes}: Assert PREFIX is a non-nil symbol |
Date: |
Sat, 2 Mar 2024 12:15:39 -0500 (EST) |
branch: externals/transient
commit 03e752d977cb2ed33930914425e108d60237443d
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
transient-parse-{suffix,suffixes}: Assert PREFIX is a non-nil symbol
This symbol is used in the names of suffixes that are defined inline.
The idea was that callers would provide the name of the corresponding
prefix as a quoted symbol. We do not check whether it actually is
prefix command, much less the correct prefix command, because the same
setup function may be shared between different prefix commands.
In #277 a user provided an example, that instead used unquoted
`transient--prefix', which is wrong since this is an object not a
symbol, resulting in extremely long names for.
(oref transient--prefix command) would work though. (Maybe we should
start falling back to that if PREFIX is nil. For now, let's not.)
---
lisp/transient.el | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lisp/transient.el b/lisp/transient.el
index 788f77f7c1..c0e4eee11c 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -1257,6 +1257,7 @@ PREFIX is a prefix command, a symbol.
SUFFIX is a suffix command or a group specification (of
the same forms as expected by `transient-define-prefix').
Intended for use in a group's `:setup-children' function."
+ (cl-assert (and prefix (symbolp prefix)))
(eval (car (transient--parse-child prefix suffix))))
(defun transient-parse-suffixes (prefix suffixes)
@@ -1265,6 +1266,7 @@ PREFIX is a prefix command, a symbol.
SUFFIXES is a list of suffix command or a group specification
(of the same forms as expected by `transient-define-prefix').
Intended for use in a group's `:setup-children' function."
+ (cl-assert (and prefix (symbolp prefix)))
(mapcar (apply-partially #'transient-parse-suffix prefix) suffixes))
;;; Edit
- [elpa] externals/transient updated (0fc87002d8 -> beecdc8579), Jonas Bernoulli, 2024/03/02
- [elpa] externals/transient a30df67b0b 2/9: Convince find-function to jump to infix command definitions again, Jonas Bernoulli, 2024/03/02
- [elpa] externals/transient 85ecbc66b6 1/9: readme: Use static gnu elpa badge, Jonas Bernoulli, 2024/03/02
- [elpa] externals/transient ba37702ab3 5/9: manual: Fix documentation for transient-toggle-level-limit, Jonas Bernoulli, 2024/03/02
- [elpa] externals/transient 8c01a1ebf8 7/9: transient--parse-child: Signal error if SPEC is nil, Jonas Bernoulli, 2024/03/02
- [elpa] externals/transient 03e752d977 8/9: transient-parse-{suffix, suffixes}: Assert PREFIX is a non-nil symbol,
Jonas Bernoulli <=
- [elpa] externals/transient cb6452847f 3/9: transient--default-infix-command: Update docstring, Jonas Bernoulli, 2024/03/02
- [elpa] externals/transient 8859863c41 6/9: transient--parse-child: Use dedicated error message, Jonas Bernoulli, 2024/03/02
- [elpa] externals/transient beecdc8579 9/9: Document that :class might be needed if :setup-children is used, Jonas Bernoulli, 2024/03/02
- [elpa] externals/transient 03997dcba8 4/9: transient--show: Fix only window height, Jonas Bernoulli, 2024/03/02