aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorF. Jason Park2023-04-14 00:07:31 -0700
committerF. Jason Park2023-05-05 17:18:01 -0700
commitb0d761be0f9b0180566d7cde1ef2eea33402dd4e (patch)
treeb36e54f3a9374c08558910f267096f1a188c4c68 /test
parent2e18ba6302f3e4aa5485eeaca39c747beb55ca8f (diff)
downloademacs-b0d761be0f9b0180566d7cde1ef2eea33402dd4e.tar.gz
emacs-b0d761be0f9b0180566d7cde1ef2eea33402dd4e.zip
Restore module var toggles in ERC's Custom buffers
* lisp/erc/erc-common.el (erc--neuter-custom-variable-state): Remove function. ERC famously toggles global minor-mode vars during normal operations, which adds noise to its customization buffers because `customize-variable-state' always sees an activated module's mode variable as having "CHANGED". To suppress this annoyance, a workaround was employed that used a dishonest `:get' function to simply return the "saved value," when present. While this improved the Customize experience, it also misled users, which likely wasn't justified. (erc--make-show-me-widget): Add helper to avoid forward declarations. (erc--prepare-custom-module-type): Don't deprive users of a working minor-mode toggle. (erc--find-feature): New function to guess the feature of a module's containing library. (define-erc-module): Remove `:get' keyword. Specify `:require' instead, whose value may be nil. Users who currently have mode vars in their `custom-file' won't be impacted by this addition because those `custom-set-variables' entries will still lack a REQUEST list and hence won't incur a startup penalty. And new users intent on using the toggle will hopefully do so with the knowledge they're opting in to requiring ERC on startup, which is not the case if they follow the recommended practice of using `erc-modules' instead. (erc-with-server-buffer): Inline `erc-server-buffer'. * test/lisp/erc/erc-tests.el (erc-process-input-line): Use helper. (define-erc-module--global): Change expected expansion. (Bug#60935)
Diffstat (limited to 'test')
-rw-r--r--test/lisp/erc/erc-tests.el7
1 files changed, 2 insertions, 5 deletions
diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el
index 5aaf7e499e3..bafe418f0cd 100644
--- a/test/lisp/erc/erc-tests.el
+++ b/test/lisp/erc/erc-tests.el
@@ -1289,15 +1289,12 @@
1289 (erc-default-recipients '("#chan")) 1289 (erc-default-recipients '("#chan"))
1290 calls) 1290 calls)
1291 (with-temp-buffer 1291 (with-temp-buffer
1292 (erc-tests--set-fake-server-process "sleep" "1")
1292 (cl-letf (((symbol-function 'erc-cmd-MSG) 1293 (cl-letf (((symbol-function 'erc-cmd-MSG)
1293 (lambda (line) 1294 (lambda (line)
1294 (push line calls) 1295 (push line calls)
1295 (should erc--called-as-input-p) 1296 (should erc--called-as-input-p)
1296 (funcall orig-erc-cmd-MSG line))) 1297 (funcall orig-erc-cmd-MSG line)))
1297 ((symbol-function 'erc-server-buffer)
1298 (lambda () (current-buffer)))
1299 ((symbol-function 'erc-server-process-alive)
1300 (lambda () t))
1301 ((symbol-function 'erc-server-send-queue) 1298 ((symbol-function 'erc-server-send-queue)
1302 #'ignore)) 1299 #'ignore))
1303 1300
@@ -2018,7 +2015,7 @@ ARG is omitted or nil.
2018Some docstring." 2015Some docstring."
2019 :global t 2016 :global t
2020 :group (erc--find-group 'mname 'malias) 2017 :group (erc--find-group 'mname 'malias)
2021 :get #'erc--neuter-custom-variable-state 2018 :require 'nil
2022 :type "mname" 2019 :type "mname"
2023 (if erc-mname-mode 2020 (if erc-mname-mode
2024 (erc-mname-enable) 2021 (erc-mname-enable)