From: Philip Kaludercic Date: Tue, 15 Jun 2021 21:44:56 +0000 (+0200) Subject: Fix edge case with single argument for rcirc-define-command X-Git-Tag: emacs-28.0.90~1748^2~10 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b5d935bb7f5a37ddeba5bf9971d5aaec9a0698c2;p=emacs.git Fix edge case with single argument for rcirc-define-command * rcirc.el (rcirc-define-command): Update regular expression generator --- diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 4d98d65d58a..d4f0ccd47cd 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -2403,12 +2403,12 @@ that, an interactive form can specified." (insert "\\`") (when arguments (dotimes (_ (1- (length arguments))) - (insert "\\(?:\\(.+?\\)")) - (insert "\\(?:[[:space:]]+\\(.*\\)\\)") + (insert "\\(?:\\(.+?\\)[[:space:]]+")) (dotimes (i (1- (length arguments))) - (when (< i optional) - (insert "?")) - (insert "\\)"))) + (if (< i optional) + (insert "\\)?") + (insert "\\)")))) + (insert "\\(.*?\\)") (insert "[[:space:]]*\\'") (buffer-string))) (argument (gensym))