mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
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)
This commit is contained in:
parent
2e18ba6302
commit
b0d761be0f
2 changed files with 49 additions and 34 deletions
|
|
@ -1289,15 +1289,12 @@
|
|||
(erc-default-recipients '("#chan"))
|
||||
calls)
|
||||
(with-temp-buffer
|
||||
(erc-tests--set-fake-server-process "sleep" "1")
|
||||
(cl-letf (((symbol-function 'erc-cmd-MSG)
|
||||
(lambda (line)
|
||||
(push line calls)
|
||||
(should erc--called-as-input-p)
|
||||
(funcall orig-erc-cmd-MSG line)))
|
||||
((symbol-function 'erc-server-buffer)
|
||||
(lambda () (current-buffer)))
|
||||
((symbol-function 'erc-server-process-alive)
|
||||
(lambda () t))
|
||||
((symbol-function 'erc-server-send-queue)
|
||||
#'ignore))
|
||||
|
||||
|
|
@ -2018,7 +2015,7 @@ ARG is omitted or nil.
|
|||
Some docstring."
|
||||
:global t
|
||||
:group (erc--find-group 'mname 'malias)
|
||||
:get #'erc--neuter-custom-variable-state
|
||||
:require 'nil
|
||||
:type "mname"
|
||||
(if erc-mname-mode
|
||||
(erc-mname-enable)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue