diff options
| author | F. Jason Park | 2023-01-24 19:49:02 -0800 |
|---|---|---|
| committer | F. Jason Park | 2023-01-24 20:19:28 -0800 |
| commit | 987e53f3e2d72d15c2d043beb2b9ed4ada118fe0 (patch) | |
| tree | 4445bf53299cdf5d4ba2ba3a4f904f25b910b381 | |
| parent | 3846e79c93bc018b28d1d24ad5f1e038e50f39be (diff) | |
| download | emacs-987e53f3e2d72d15c2d043beb2b9ed4ada118fe0.tar.gz emacs-987e53f3e2d72d15c2d043beb2b9ed4ada118fe0.zip | |
; * doc/misc/erc.texi: Improve Local Modules section.
| -rw-r--r-- | doc/misc/erc.texi | 47 |
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. | |||
| 539 | At present, the only such module is @code{networks}, whose library ERC | 539 | At present, the only such module is @code{networks}, whose library ERC |
| 540 | always loads anyway. | 540 | always 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 | ||
| 545 | All modules operate as minor modes under the hood, and some newer ones | 546 | All modules operate as minor modes under the hood, and some newer ones |
| 546 | may be defined as buffer-local. These so-called ``local modules'' are | 547 | may be defined as buffer-local. These so-called ``local modules'' are |
| 547 | a work in progress and their behavior and interface are subject to | 548 | a work in progress and their behavior and interface are subject to |
| 548 | change. As of ERC 5.5, the only practical differences are | 549 | change. 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 |
| 553 | IRC sessions and override @code{erc-module} membership when influencing | 554 | across IRC sessions and override @code{erc-module} membership when |
| 554 | module activation in new sessions. | 555 | influencing module activation. |
| 555 | @item | 556 | @item |
| 556 | Removing a local module from @code{erc-modules} via Customize not only | 557 | Removing a local module from @code{erc-modules} via Customize not only |
| 557 | disables its mode but also kills its control variable in all ERC | 558 | disables its mode but also kills its control variable in all ERC |
| 558 | buffers. | 559 | buffers. |
| 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 |
| 562 | to their global counterparts. (More on this just below.) | 563 | differently than their global counterparts. |
| 563 | @end enumerate | 564 | @end enumerate |
| 564 | 565 | ||
| 565 | By default, all local-mode toggles, like @code{erc-sasl-mode}, only | 566 | In target buffers, a local module's activation state survives |
| 566 | affect 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 | 568 | final say. For example, a module may reset all instances of itself in |
| 568 | connection when called interactively. Keep in mind that whether | 569 | its network context upon reconnecting. Moreover, the value of a mode |
| 569 | enabled or not, a module may effectively be ``inert'' in certain types | 570 | variable may be meaningless in buffers that its module has no interest |
| 570 | of buffers, such as queries and channels. Whatever the case, a local | 571 | in. For example, the value of @code{erc-sasl-mode} doesn't matter in |
| 571 | toggle never mutates @code{erc-modules}. | 572 | target buffers and may even remain non-@code{nil} after SASL has been |
| 573 | disabled for the current connection (and vice versa). | ||
| 574 | |||
| 575 | When it comes to server buffers, a module's activation state only | ||
| 576 | persists for sessions revived via the automatic reconnection mechanism | ||
| 577 | or a manual @samp{/reconnect} issued at the prompt. In other words, | ||
| 578 | this doesn't apply to sessions revived by an entry-point command, such | ||
| 579 | as @code{erc-tls}, because such commands always ensure a clean slate | ||
| 580 | by looking only to @code{erc-modules}. Although a session revived in | ||
| 581 | this manner may indeed harvest other information from a previous | ||
| 582 | server buffer, it simply doesn't care which modules might have been | ||
| 583 | active during that connection. | ||
| 584 | |||
| 585 | Lastly, a local mode's toggle command, like @code{erc-sasl-mode}, only | ||
| 586 | affects the current buffer, but its ``non-mode'' cousins, like | ||
| 587 | @code{erc-sasl-enable} and @code{erc-sasl-disable}, operate on all | ||
| 588 | buffers belonging to their connection (when called interactively). | ||
| 589 | And 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 |