Allow ERC's module toggles access to the prefix arg
authorF. Jason Park <jp@neverwas.me>
Mon, 15 May 2023 07:16:00 +0000 (00:16 -0700)
committerF. Jason Park <jp@neverwas.me>
Fri, 14 Jul 2023 01:45:31 +0000 (18:45 -0700)
commit30fe8703e60d0b756c19f52a6758889600b7b396
tree8a7fd1fb2abf09b7145bce1e0108c89033219476
parente51e43b7046b56c58310854182a1d589ee4c770c
Allow ERC's module toggles access to the prefix arg

* lisp/erc/erc-common.el (erc--module-toggle-prefix-arg): Add internal
variable for preserving the `arg' passed to a module's minor-mode
toggle, which was previously discarded.  Doing this lets modules that
are more interactive in nature overload their mode toggles with
alternate behaviors.
(define-erc-module): Bind `erc--module-toggle-prefix-arg' to the `arg'
parameter, which is normally defined inside a `define-minor-mode' body
form.
* test/lisp/erc/erc-tests.el (define-erc-module--global,
define-erc-module--local): Expect activation body to be wrapped by a
let form binding `erc--module-toggle-prefix-arg'.  (Bug#63595)
lisp/erc/erc-common.el
test/lisp/erc/erc-tests.el