master badce2d952d 9/9: Allow slashes and periods in ERC ISUPPORT params
"F. Jason Park" <[email protected]> Tue, 30 Jun 2026 23:37:23 -0400 (EDT)
| Newsgroups | gmane.emacs.diffs |
|---|---|
| Message-ID | <[email protected]> |
branch: master commit badce2d952db81c91521ddc988a925154370d56a Author: F. Jason Park <[email protected]> Commit: F. Jason Park <[email protected]> Allow slashes and periods in ERC ISUPPORT params * lisp/erc/erc-backend.el (erc-server-005): Add "." and "/" to regexp for parameter keys as per the updated recommendation of the living specification. See https://github.com/ircdocs/modern-irc/pull/251 and the corresponding issue it closed. * test/lisp/erc/erc-tests.el (erc-server-005): Expect slashes and periods in parameter keys. --- lisp/erc/erc-backend.el | 4 ++-- test/lisp/erc/erc-tests.el | 15 ++++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 819b8ae5033..85475a4c52f 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -2381,8 +2381,8 @@ A server may send more than one 005 message." value negated) (when (string-match - (rx bot (| (: (group (+ (any "A-Z"))) "=" (group (* nonl))) - (: (? (group "-")) (group (+ (any "A-Z"))))) + (rx bot (| (: (group (+ (any "A-Z./"))) "=" (group (* nonl))) + (: (? (group "-")) (group (+ (any "A-Z./"))))) eot) section) (setq key (or (match-string 1 section) (match-string 4 section)) diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el index 74c1a4bfa19..953be0c91fb 100644 --- a/test/lisp/erc/erc-tests.el +++ b/test/lisp/erc/erc-tests.el @@ -1305,7 +1305,8 @@ (lambda (_ _ _ line) (push line calls)))) (ert-info ("Baseline") - (setq args '("tester" "BOT=B" "CHANTYPES=" "EXCEPTS" "PREFIX=(ov)@+" + (setq args '("tester" "BOT=B" "A.B/c=d" + "CHANTYPES=" "EXCEPTS" "PREFIX=(ov)@+" "are supp...") parsed (make-erc-response :command-args args :command "005")) @@ -1316,14 +1317,17 @@ ;; Should be ("CHANTYPES") but ;; retained for compatibility. ("CHANTYPES" . "") + ("A.B/c" . "d") ("BOT" . "B")))) (should (zerop (hash-table-count erc--isupport-params))) (should (equal "(ov)@+" (erc--get-isupport-entry 'PREFIX t))) (should (equal '(EXCEPTS) (erc--get-isupport-entry 'EXCEPTS))) (should (equal "B" (erc--get-isupport-entry 'BOT t))) - (should (string= - (pop calls) - "BOT=B CHANTYPES= EXCEPTS PREFIX=(ov)@+ are supp...")) + (should (equal "d" (erc--get-isupport-entry 'A.B/c t))) + (should + (string= + "BOT=B A.B/c=d CHANTYPES= EXCEPTS PREFIX=(ov)@+ are supp..." + (pop calls))) (should (equal args (erc-response.command-args parsed))))) (erc-call-hooks nil parsed)) @@ -1336,7 +1340,8 @@ (setq verify (lambda () (should (equal erc-server-parameters - '(("PREFIX" . "(ohv)@%+") ("BOT" . "B")))) + '(("PREFIX" . "(ohv)@%+") ("A.B/c" . "d") + ("BOT" . "B")))) (should (string-prefix-p "-EXCEPTS -CHANTYPES -FAKE PREFIX=(ohv)@%+ " (pop calls)))