branch: elpa/transient commit 8daf9890ee65335a23eebc8919e9cfdd7c7249eb Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
transient--insert-suffix: Signal error if location is invalid Closes #374. --- docs/transient.org | 9 --------- docs/transient.texi | 9 --------- lisp/transient.el | 10 +++++----- 3 files changed, 5 insertions(+), 23 deletions(-) diff --git a/docs/transient.org b/docs/transient.org index 97a3f9e2d3..a2690443b7 100644 --- a/docs/transient.org +++ b/docs/transient.org @@ -899,15 +899,6 @@ that tree are not objects but have the form {{{codevar((LEVEL CLASS PLIST))}}}, This function edits the suffix or group at {{{var(LOC)}}} in {{{var(PREFIX)}}}, by setting the {{{var(PROP)}}} of its plist to {{{var(VALUE)}}}. -Most of these functions do not signal an error if they cannot perform -the requested modification. The functions that insert new suffixes -show a warning if {{{var(LOC)}}} cannot be found in {{{var(PREFIX,)}}} without signaling an -error. The reason for doing it like this is that establishing a key -binding (and that is what we essentially are trying to do here) should -not prevent the rest of the configuration from loading. Among these -functions only ~transient-get-suffix~ and ~transient-suffix-put~ may -signal an error. - * Defining New Commands ** Technical Introduction diff --git a/docs/transient.texi b/docs/transient.texi index bb4100d2f4..8ada4d1946 100644 --- a/docs/transient.texi +++ b/docs/transient.texi @@ -1055,15 +1055,6 @@ This function edits the suffix or group at @var{LOC} in @var{PREFIX}, by setting the @var{PROP} of its plist to @var{VALUE}. @end defun -Most of these functions do not signal an error if they cannot perform -the requested modification. The functions that insert new suffixes -show a warning if @var{LOC} cannot be found in @var{PREFIX} without signaling an -error. The reason for doing it like this is that establishing a key -binding (and that is what we essentially are trying to do here) should -not prevent the rest of the configuration from loading. Among these -functions only @code{transient-get-suffix} and @code{transient-suffix-put} may -signal an error. - @node Defining New Commands @chapter Defining New Commands diff --git a/lisp/transient.el b/lisp/transient.el index 165089f306..91ad2481e4 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -1455,14 +1455,14 @@ Intended for use in a group's `:setup-children' function." (setq suf (eval suf t)) (cond ((not mem) - (message "Cannot insert %S into %s; %s not found" - suffix prefix loc)) + (error "Cannot insert %S into %s; %s not found" + suffix prefix loc)) ((or (and (vectorp suffix) (not (vectorp elt))) (and (listp suffix) (vectorp elt)) (and (stringp suffix) (vectorp elt))) - (message "Cannot place %S into %s at %s; %s" - suffix prefix loc - "suffixes and groups cannot be siblings")) + (error "Cannot place %S into %s at %s; %s" + suffix prefix loc + "suffixes and groups cannot be siblings")) (t (when-let* (((not (eq keep-other 'always))) (bindingp (listp suf))