emacs-elpa-diffs
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]