diff options
author | F. Jason Park <jp@neverwas.me> | 2021-07-12 03:44:28 -0700 |
---|---|---|
committer | Amin Bandali <bandali@gnu.org> | 2022-11-23 19:56:31 -0500 |
commit | 4c4936fab2ecd97ff6e03e5cfe12def4626c718b (patch) | |
tree | 573e992298f17fd23709fddafb2979a49646b2d9 /test/lisp/erc/resources | |
parent | dc6ff142bc1c1a8596436e08ddbccb39d8fdcf39 (diff) | |
download | emacs-4c4936fab2ecd97ff6e03e5cfe12def4626c718b.tar.gz emacs-4c4936fab2ecd97ff6e03e5cfe12def4626c718b.tar.bz2 emacs-4c4936fab2ecd97ff6e03e5cfe12def4626c718b.zip |
Support local ERC modules in erc-mode buffers
* doc/misc/erc.texi: Mention local modules in Modules chapter.
* etc/ERC-NEWS: Mention changes to `erc-update-modules'.
* lisp/erc/erc.el (erc-migrate-modules): Add some missing mappings.
(erc-modules): When a user removes a module, disable it and kill its
local variable in all ERC buffers.
(erc-update-modules): Move body of `erc-update-modules' to new
internal function.
(erc--update-modules): Add new function, a renamed and slightly
modified version of `erc-update-modules'. Specifically, change return
value from nil to a list of minor-mode commands for local modules.
Use `custom-variable-p' to detect flavor.
(erc--merge-local-modes): Add helper for finding local modules
already active as minor modes in an ERC buffer.
(erc-open): Replace `erc-update-modules' with `erc--update-modules'.
Defer enabling of local modules via `erc--update-modules' until after
buffer is initialized with other local vars. Also defer major-mode
hooks so they can detect things like whether the buffer is a server or
target buffer. Also ensure local module setup code can detect when
`erc-open' was called with a non-nil `erc--server-reconnecting'.
* lisp/erc/erc-common.el (erc--module-name-migrations,
erc--features-to-modules, erc--modules-to-features): Add alists of
old-to-new module names to support module-name migrations.
(erc--assemble-toggle): Add new helper for constructing mode toggles,
like `erc-sasl-enable'.
(define-erc-modules): Defer to `erc--assemble-toggle' to create toggle
commands.
(erc--normalize-module-symbol): Add helper for `erc-migrate-modules'.
* lisp/erc/erc-goodies.el: Require cl-lib.
* test/lisp/erc/erc-tests.el (erc-migrate-modules,
erc--update-modules): Add rudimentary unit tests asserting correct
module-name mappings.
(erc--merge-local-modes): Add test for helper.
(define-erc-module--global, define-erc-module--local): Add tests
asserting module-creation macro. (Bug#57955.)
Diffstat (limited to 'test/lisp/erc/resources')
0 files changed, 0 insertions, 0 deletions