aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorF. Jason Park2023-05-15 00:16:00 -0700
committerF. Jason Park2023-07-13 18:45:31 -0700
commit30fe8703e60d0b756c19f52a6758889600b7b396 (patch)
tree8a7fd1fb2abf09b7145bce1e0108c89033219476 /test
parente51e43b7046b56c58310854182a1d589ee4c770c (diff)
downloademacs-30fe8703e60d0b756c19f52a6758889600b7b396.tar.gz
emacs-30fe8703e60d0b756c19f52a6758889600b7b396.zip
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)
Diffstat (limited to 'test')
-rw-r--r--test/lisp/erc/erc-tests.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el
index 3f36e7c94f6..cc69641fb0b 100644
--- a/test/lisp/erc/erc-tests.el
+++ b/test/lisp/erc/erc-tests.el
@@ -2204,9 +2204,10 @@ Some docstring."
2204 :group (erc--find-group 'mname 'malias) 2204 :group (erc--find-group 'mname 'malias)
2205 :require 'nil 2205 :require 'nil
2206 :type "mname" 2206 :type "mname"
2207 (if erc-mname-mode 2207 (let ((erc--module-toggle-prefix-arg arg))
2208 (erc-mname-enable) 2208 (if erc-mname-mode
2209 (erc-mname-disable))) 2209 (erc-mname-enable)
2210 (erc-mname-disable))))
2210 2211
2211 (defun erc-mname-enable () 2212 (defun erc-mname-enable ()
2212 "Enable ERC mname mode." 2213 "Enable ERC mname mode."
@@ -2259,9 +2260,10 @@ ARG is omitted or nil.
2259Some docstring." 2260Some docstring."
2260 :global nil 2261 :global nil
2261 :group (erc--find-group 'mname nil) 2262 :group (erc--find-group 'mname nil)
2262 (if erc-mname-mode 2263 (let ((erc--module-toggle-prefix-arg arg))
2263 (erc-mname-enable) 2264 (if erc-mname-mode
2264 (erc-mname-disable))) 2265 (erc-mname-enable)
2266 (erc-mname-disable))))
2265 2267
2266 (defun erc-mname-enable (&optional ,arg-en) 2268 (defun erc-mname-enable (&optional ,arg-en)
2267 "Enable ERC mname mode. 2269 "Enable ERC mname mode.