emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 5df658a96a: Fix handling of intspecs as string by rcirc-define-co


From: Philip Kaludercic
Subject: master 5df658a96a: Fix handling of intspecs as string by rcirc-define-command
Date: Tue, 19 Apr 2022 07:18:54 -0400 (EDT)

branch: master
commit 5df658a96a4bc7f8f96e3b2bf58dad32f81ce06a
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>

    Fix handling of intspecs as string by rcirc-define-command
    
    * rcirc.el (rcirc-define-command): Check if an interactive
      specification is a string, in which case it was to be wrapped in a
      list so that the result of its interpretation is passed as the first
      argument of the command resulting from the macro expansion.
---
 lisp/net/rcirc.el | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index f34be6daf3..31888f3913 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -2616,15 +2616,22 @@ that, an interactive form can specified."
        (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))
+                  "\nby `rcirc-buffer-process' and `rcirc-target' will be 
used.")
+         (interactive ,(if (stringp interactive-spec)
+                           ;; HACK: Necessary to wrap the result of
+                           ;; the interactive spec in a list.
+                           `(list (call-interactively
+                                   (lambda (&rest args)
+                                     (interactive ,interactive-spec)
+                                     args)))
+                         `(list ,interactive-spec)))
          (unless (if (listp ,argument)
                      (<= ,required (length ,argument) ,total)
                    (string-match ,regexp ,argument))
            (user-error "Malformed input (%s): %S" ',command ,argument))
          (push ,(upcase (symbol-name command)) rcirc-pending-requests)
          (let ((process (or process (rcirc-buffer-process)))
-              (target (or target rcirc-target)))
+               (target (or target rcirc-target)))
            (ignore target process)
            (let (,@(cl-loop
                     for i from 0 for arg in (delq '&optional arguments)



reply via email to

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