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 /etc | |
parent | dc6ff142bc1c1a8596436e08ddbccb39d8fdcf39 (diff) | |
download | emacs-4c4936fab2ecd97ff6e03e5cfe12def4626c718b.tar.gz |
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 'etc')
-rw-r--r-- | etc/ERC-NEWS | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index f638d4717a1..15f7fe84dd9 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -125,6 +125,15 @@ The function 'erc-auto-query' was deemed too difficult to reason through and has thus been deprecated with no public replacement; it has also been removed from the client code path. +The function 'erc-open' now delays running 'erc-mode-hook' members +until most local session variables have been initialized (minus those +connection-related ones in erc-backend). 'erc-open' also no longer +calls 'erc-update-modules', although modules are still activated +in an identical fashion. + +Some groundwork has been laid for what may become a new breed of ERC +module, namely, "connection-local" (or simply "local") modules. + A few internal variables have been introduced that could just as well have been made public, possibly as user options. Likewise for some internal functions. As always, users needing such functionality |