diff options
| author | F. Jason Park | 2025-02-04 06:11:50 -0800 |
|---|---|---|
| committer | F. Jason Park | 2025-02-07 20:21:36 -0800 |
| commit | e9408918f4e7fe00eb4e25e1e5428fb26c4ad847 (patch) | |
| tree | 646d187e5252a184e3303fb00dbe1809a093847c /test | |
| parent | 0e4883f18eecea59e537e2368a0f5674888a1af7 (diff) | |
| download | emacs-e9408918f4e7fe00eb4e25e1e5428fb26c4ad847.tar.gz emacs-e9408918f4e7fe00eb4e25e1e5428fb26c4ad847.zip | |
More clearly define local module behavior in ERC
* doc/misc/erc.texi (Modules): Label all local modules as being such.
Move `querypoll' to the auxiliary section. Rework entire "Local
Modules" portion.
* lisp/erc/erc-goodies.el (erc-keep-place-indicator-mode)
(erc-command-indicator-mode): Mention what buffer types they operate in.
* lisp/erc/erc-nicks.el (erc-nicks-mode): Mention the mode is enabled in
all buffers.
* lisp/erc/erc-notify.el (erc-querypoll-mode): Mention which buffers it
operates in.
* lisp/erc/erc-sasl.el (erc-sasl-mode): Disable completely in target
buffers so its mode variable is nil.
* lisp/erc/erc-services.el (erc-services-regain-mode): Disable in target
buffers.
* lisp/erc/erc.el (erc-open): When activating local modules, skip those
that have just been enabled by a fellow module. Do this even though
their setup code is meant to be idempotent.
* test/lisp/erc/erc-scenarios-base-local-modules.el
(erc-scenarios-base-local-modules--toggle-helpers): Revise to assert
current behavior. (Bug#57955)
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/erc/erc-scenarios-base-local-modules.el | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/test/lisp/erc/erc-scenarios-base-local-modules.el b/test/lisp/erc/erc-scenarios-base-local-modules.el index 71923cc11f2..1d670b8f508 100644 --- a/test/lisp/erc/erc-scenarios-base-local-modules.el +++ b/test/lisp/erc/erc-scenarios-base-local-modules.el | |||
| @@ -117,20 +117,25 @@ | |||
| 117 | (erc-cmd-QUIT "") | 117 | (erc-cmd-QUIT "") |
| 118 | (funcall expect 10 "finished"))) | 118 | (funcall expect 10 "finished"))) |
| 119 | 119 | ||
| 120 | (ert-info ("Disabling works from a target buffer") | 120 | (ert-info ("Explicit disabling affects entire session") |
| 121 | ;; Even though the mode variable is nil (but locally bound) in | ||
| 122 | ;; this target buffer, disabling interactively with | ||
| 123 | ;; `erc-sasl-disable', deactivates the module session-wide. | ||
| 121 | (with-current-buffer "#chan" | 124 | (with-current-buffer "#chan" |
| 122 | (should erc-sasl-mode) | ||
| 123 | (call-interactively #'erc-sasl-disable) | ||
| 124 | (should-not erc-sasl-mode) | 125 | (should-not erc-sasl-mode) |
| 125 | (should (local-variable-p 'erc-sasl-mode)) | 126 | (should (local-variable-p 'erc-sasl-mode)) |
| 127 | (should (buffer-local-value 'erc-sasl-mode (get-buffer "foonet"))) | ||
| 128 | (call-interactively #'erc-sasl-disable) | ||
| 126 | (should-not (buffer-local-value 'erc-sasl-mode (get-buffer "foonet"))) | 129 | (should-not (buffer-local-value 'erc-sasl-mode (get-buffer "foonet"))) |
| 130 | (should-not erc-sasl-mode) | ||
| 127 | (erc-cmd-RECONNECT) | 131 | (erc-cmd-RECONNECT) |
| 128 | (funcall expect 10 "Some enigma, some riddle") | 132 | (funcall expect 10 "Some enigma, some riddle") |
| 129 | (should-not erc-sasl-mode) ; regression | 133 | (should-not erc-sasl-mode) |
| 130 | (should (local-variable-p 'erc-sasl-mode))) | 134 | (should (local-variable-p 'erc-sasl-mode))) |
| 131 | 135 | ||
| 132 | (with-current-buffer "foonet" | 136 | (with-current-buffer "foonet" |
| 133 | (should (local-variable-p 'erc-sasl-mode)) | 137 | (should (local-variable-p 'erc-sasl-mode)) |
| 138 | (should-not erc-sasl-mode) | ||
| 134 | (funcall expect 10 "User modes for tester`") | 139 | (funcall expect 10 "User modes for tester`") |
| 135 | (erc-cmd-QUIT "") | 140 | (erc-cmd-QUIT "") |
| 136 | (funcall expect 10 "finished"))) | 141 | (funcall expect 10 "finished"))) |
| @@ -139,7 +144,8 @@ | |||
| 139 | (with-current-buffer "#chan" | 144 | (with-current-buffer "#chan" |
| 140 | (call-interactively #'erc-sasl-enable) | 145 | (call-interactively #'erc-sasl-enable) |
| 141 | (should (local-variable-p 'erc-sasl-mode)) | 146 | (should (local-variable-p 'erc-sasl-mode)) |
| 142 | (should erc-sasl-mode) | 147 | (should-not erc-sasl-mode) |
| 148 | (should (buffer-local-value 'erc-sasl-mode (get-buffer "foonet"))) | ||
| 143 | (erc-cmd-RECONNECT) | 149 | (erc-cmd-RECONNECT) |
| 144 | (funcall expect 10 "Well met; good morrow, Titus and Hortensius.") | 150 | (funcall expect 10 "Well met; good morrow, Titus and Hortensius.") |
| 145 | (erc-cmd-QUIT "")) | 151 | (erc-cmd-QUIT "")) |