[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient 7e827c31d6 6/8: transient--expand-define-args
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient 7e827c31d6 6/8: transient--expand-define-args: Validate command body |
Date: |
Mon, 29 Apr 2024 09:40:41 -0400 (EDT) |
branch: externals/transient
commit 7e827c31d63e6aaff6511c33f436dbcba619de4e
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
transient--expand-define-args: Validate command body
---
lisp/transient.el | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/lisp/transient.el b/lisp/transient.el
index 5746f242c6..75b4585b79 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -1010,7 +1010,7 @@ keyword.
(indent defun)
(doc-string 3))
(pcase-let ((`(,class ,slots ,_ ,docstr ,_ ,interactive-only)
- (transient--expand-define-args args arglist)))
+ (transient--expand-define-args args arglist t)))
`(progn
(defalias ',name #'transient--default-infix-command)
(put ',name 'interactive-only ,interactive-only)
@@ -1065,7 +1065,7 @@ commands are aliases for."
#'transient--find-function-advised-original)
(eval-and-compile
- (defun transient--expand-define-args (args &optional arglist)
+ (defun transient--expand-define-args (args &optional arglist nobody)
(unless (listp arglist)
(error "Mandatory ARGLIST is missing"))
(let (class keys suffixes docstr declare (interactive-only t))
@@ -1090,6 +1090,12 @@ commands are aliases for."
(delq int declare))
(unless (cdr declare)
(setq declare nil)))
+ (cond
+ ((not args))
+ (nobody
+ (error "transient-define-infix: No function body allowed"))
+ ((not (eq (car-safe (nth (if declare 1 0) args)) 'interactive))
+ (error "transient-define-*: Interactive form missing")))
(list (if (eq (car-safe class) 'quote)
(cadr class)
class)
- [elpa] externals/transient updated (2698d62d2e -> 2dd0102ec3), Jonas Bernoulli, 2024/04/29
- [elpa] externals/transient 7e827c31d6 6/8: transient--expand-define-args: Validate command body,
Jonas Bernoulli <=
- [elpa] externals/transient 8a80e9526b 4/8: transient-information*: New class, Jonas Bernoulli, 2024/04/29
- [elpa] externals/transient 91dd7bb33e 3/8: transient--func-arity: New function, Jonas Bernoulli, 2024/04/29
- [elpa] externals/transient fcc60e272d 5/8: transient-define-*: Allow overwriting interactive-only, Jonas Bernoulli, 2024/04/29
- [elpa] externals/transient f1491361a7 7/8: transient-define-suffix: Update debug specification, Jonas Bernoulli, 2024/04/29
- [elpa] externals/transient 2dd0102ec3 8/8: transient-define-infix: Update debug specification and documentation, Jonas Bernoulli, 2024/04/29
- [elpa] externals/transient 1251faf0a6 2/8: Remove transient-plist-to-alist, Jonas Bernoulli, 2024/04/29
- [elpa] externals/transient 53198a3df5 1/8: Update contact information, Jonas Bernoulli, 2024/04/29