Subject: bug#57955: 29.0.50; Allow session-local ERC modules

From: "J.P." <[email-masked]>
Date: Sun, 21 May 2023 21:05:41 -0700

"J.P." <[email-masked]> writes:

> Brief update. The scope of this change has shrunk considerably. The
> deferred loading and migrations stuff still applies, but the main
> user-facing aspect, namely, support for let-binding a module's options
> on entry-point invocation, has been abandoned (for now).
>
> After looking into connection-local variables a bit, following Michael's
> suggestion up thread, I have come to the opinion that the let-binding
> idea was not fully formed and that options granularity is worthy of more
> meditation and discussion and thus not a realistic goal for Emacs 5.5.

To help with managing local modules, I've added some (possibly
temporary) convenience functions and other supporting items as part of
bug#60936. The most useful are:

  * macro `erc--restore-initialize-priors'

    This restores local variables from a previous session on major-mode
    hook or slightly later. The effect is similar to that provided by
    the `permanent-local' property, which we may end up settling for if
    the dream of context-local user options evaporates for good. This
    may also be of interest to global modules intended primarily for
    interactive use, such as the proposed `bufbar' and `nickbar'
    (bug#63595).

  * variable `erc--updating-modules-p'

    This is non-nil when running `erc-update-modules' in `erc-open'. It
    allows global modules to suppress superfluous buffer initialization
    pre-major-mode while still making that same init code available on
    demand for interactive invocations and indirect activation by
    dependent modules.

Please keep in mind that these may change or disappear at any time.