* lisp/erc/erc.el (erc--merge-local-modes): Look for a symbol's
`erc-module' property before examining its name.
* test/lisp/erc/erc-tests.el (erc-parse-modes): Expand case to cover
alternating plus and minus mode changes.
(cherry picked from commit
dc7c38ed9ec85e2e7cbe3c9fcb3b6d5dbb5aa206)
(if old-vars
(let ((out (list (reverse new-modes))))
(pcase-dolist (`(,k . ,v) old-vars)
- (when (and (string-prefix-p "erc-" (symbol-name k))
- (string-suffix-p "-mode" (symbol-name k))
- (get k 'erc-module))
+ (when (and (get k 'erc-module)
+ (string-prefix-p "erc-" (symbol-name k))
+ (string-suffix-p "-mode" (symbol-name k)))
(if v
(cl-pushnew k (car out))
(setf (car out) (delq k (car out)))
(should (equal (erc-parse-modes "-o bob") '(nil nil (("o" off "bob")))))
(should (equal (erc-parse-modes "+uo bob") '(("u") nil (("o" on "bob")))))
(should (equal (erc-parse-modes "+o-u bob") '(nil ("u") (("o" on "bob")))))
+
(should (equal (erc-parse-modes "+uo-tv bob alice")
'(("u") ("t") (("o" on "bob") ("v" off "alice")))))
+ (should (equal (erc-parse-modes "+u-t+o-v bob alice")
+ '(("u") ("t") (("o" on "bob") ("v" off "alice")))))
(ert-info ("Modes of type B are always grouped as unary")
(should (equal (erc-parse-modes "+k h2") '(nil nil (("k" on "h2")))))