aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorF. Jason Park2023-01-24 19:49:02 -0800
committerF. Jason Park2023-01-24 20:19:28 -0800
commit987e53f3e2d72d15c2d043beb2b9ed4ada118fe0 (patch)
tree4445bf53299cdf5d4ba2ba3a4f904f25b910b381
parent3846e79c93bc018b28d1d24ad5f1e038e50f39be (diff)
downloademacs-987e53f3e2d72d15c2d043beb2b9ed4ada118fe0.tar.gz
emacs-987e53f3e2d72d15c2d043beb2b9ed4ada118fe0.zip
; * doc/misc/erc.texi: Improve Local Modules section.
-rw-r--r--doc/misc/erc.texi47
1 files changed, 33 insertions, 14 deletions
diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi
index 23cdcbff575..8030dfa4bb7 100644
--- a/doc/misc/erc.texi
+++ b/doc/misc/erc.texi
@@ -539,36 +539,55 @@ so demands special precautions to avoid degrading the user experience.
539At present, the only such module is @code{networks}, whose library ERC 539At present, the only such module is @code{networks}, whose library ERC
540always loads anyway. 540always loads anyway.
541 541
542@anchor{Local Modules}
542@subheading Local Modules 543@subheading Local Modules
543@cindex local modules 544@cindex local modules
544 545
545All modules operate as minor modes under the hood, and some newer ones 546All modules operate as minor modes under the hood, and some newer ones
546may be defined as buffer-local. These so-called ``local modules'' are 547may be defined as buffer-local. These so-called ``local modules'' are
547a work in progress and their behavior and interface are subject to 548a work in progress and their behavior and interface are subject to
548change. As of ERC 5.5, the only practical differences are 549change. As of ERC 5.5, the only practical differences are as follows:
549 550
550@enumerate 551@enumerate
551@item 552@item
552``Control variables,'' like @code{erc-sasl-mode}, are stateful across 553``Control variables,'' like @code{erc-sasl-mode}, retain their values
553IRC sessions and override @code{erc-module} membership when influencing 554across IRC sessions and override @code{erc-module} membership when
554module activation in new sessions. 555influencing module activation.
555@item 556@item
556Removing a local module from @code{erc-modules} via Customize not only 557Removing a local module from @code{erc-modules} via Customize not only
557disables its mode but also kills its control variable in all ERC 558disables its mode but also kills its control variable in all ERC
558buffers. 559buffers.
559@item 560@item
560``Mode toggles,'' like @code{erc-sasl-mode} and 561``Mode toggles,'' like @code{erc-sasl-mode} and the complementary
561@code{erc-sasl-enable}, behave differently relative to each other and 562@code{erc-sasl-enable}/@code{erc-sasl-disable} pairing, behave
562to their global counterparts. (More on this just below.) 563differently than their global counterparts.
563@end enumerate 564@end enumerate
564 565
565By default, all local-mode toggles, like @code{erc-sasl-mode}, only 566In target buffers, a local module's activation state survives
566affect the current buffer, but their ``non-mode'' variants, such as 567``reassociation'' by default, but modules themselves always have the
567@code{erc-sasl-enable}, operate on all buffers belonging to a 568final say. For example, a module may reset all instances of itself in
568connection when called interactively. Keep in mind that whether 569its network context upon reconnecting. Moreover, the value of a mode
569enabled or not, a module may effectively be ``inert'' in certain types 570variable may be meaningless in buffers that its module has no interest
570of buffers, such as queries and channels. Whatever the case, a local 571in. For example, the value of @code{erc-sasl-mode} doesn't matter in
571toggle never mutates @code{erc-modules}. 572target buffers and may even remain non-@code{nil} after SASL has been
573disabled for the current connection (and vice versa).
574
575When it comes to server buffers, a module's activation state only
576persists for sessions revived via the automatic reconnection mechanism
577or a manual @samp{/reconnect} issued at the prompt. In other words,
578this doesn't apply to sessions revived by an entry-point command, such
579as @code{erc-tls}, because such commands always ensure a clean slate
580by looking only to @code{erc-modules}. Although a session revived in
581this manner may indeed harvest other information from a previous
582server buffer, it simply doesn't care which modules might have been
583active during that connection.
584
585Lastly, a local mode's toggle command, like @code{erc-sasl-mode}, only
586affects the current buffer, but its ``non-mode'' cousins, like
587@code{erc-sasl-enable} and @code{erc-sasl-disable}, operate on all
588buffers belonging to their connection (when called interactively).
589And unlike global toggles, none of these ever mutates
590@code{erc-modules}.
572 591
573 592
574@c PRE5_4: Document every option of every module in its own subnode 593@c PRE5_4: Document every option of every module in its own subnode