Fix interactive forms for rcirc-define-command

* rcirc.el (rcirc-define-command): Handle string descriptors correctly
This commit is contained in:
Philip Kaludercic 2021-09-14 22:10:14 +02:00
parent 3405c85ae4
commit 5ebad79e62
No known key found for this signature in database
GPG key ID: 181F5B95AE30B336

View file

@ -2569,13 +2569,13 @@ that, an interactive form can specified."
(when (stringp (car body))
(setq documentation (pop body)))
(when (eq (car-safe (car-safe body)) 'interactive)
(setq interactive-spec (cdr (pop body))))
(setq interactive-spec (cadr (pop body))))
`(progn
(defun ,fn-name (,argument &optional process target)
,(concat documentation
"\n\nNote: If PROCESS or TARGET are nil, the values given"
"\nby `rcirc-buffer-process' and `rcirc-target' will be used.")
(interactive (list ,@interactive-spec))
(interactive ,interactive-spec)
(unless (if (listp ,argument)
(<= ,required (length ,argument) ,total)
(string-match ,regexp ,argument))