From b5d935bb7f5a37ddeba5bf9971d5aaec9a0698c2 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Tue, 15 Jun 2021 23:44:56 +0200 Subject: [PATCH] Fix edge case with single argument for rcirc-define-command * rcirc.el (rcirc-define-command): Update regular expression generator --- lisp/net/rcirc.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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)) -- 2.39.2