diff options
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/misc/erc.texi | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi index 3297d8b17f0..3bfa240cacc 100644 --- a/doc/misc/erc.texi +++ b/doc/misc/erc.texi | |||
| @@ -653,6 +653,41 @@ And unlike global toggles, none of these ever mutates | |||
| 653 | @code{erc-modules}. | 653 | @code{erc-modules}. |
| 654 | 654 | ||
| 655 | 655 | ||
| 656 | @anchor{Module Loading} | ||
| 657 | @subheading Module Loading | ||
| 658 | @cindex module loading | ||
| 659 | |||
| 660 | ERC loads internal modules in alphabetical order and third-party | ||
| 661 | modules as they appear in @code{erc-modules}. When defining your own | ||
| 662 | module, take care to ensure ERC can find it. An easy way to do that | ||
| 663 | is by mimicking the example in the doc string for | ||
| 664 | @code{define-erc-module}. For historical reasons, ERC also falls back | ||
| 665 | to @code{require}ing features. For example, if some module | ||
| 666 | @code{<mymod>} in @code{erc-modules} lacks a corresponding | ||
| 667 | @code{erc-<mymod>-mode} command, ERC will attempt to load the library | ||
| 668 | @code{erc-<mymod>} prior to connecting. If this fails, ERC signals an | ||
| 669 | error. Users wanting to define modules in an init files should | ||
| 670 | @code{(provide 'erc-<my-mod>)} somewhere to placate ERC. Dynamically | ||
| 671 | generating modules on the fly is not supported. | ||
| 672 | |||
| 673 | Sometimes, packages attempt to autoload a module's definition instead | ||
| 674 | of its minor-mode command, which breaks the link between the library | ||
| 675 | and the module. This means that enabling the mode by invoking its | ||
| 676 | command toggle isn't enough to load its defining library. Such | ||
| 677 | packages should instead only supply autoload cookies featuring an | ||
| 678 | explicit @code{autoload} form for their module's minor-mode command. | ||
| 679 | As mentioned above, packages can also usually avoid autoload cookies | ||
| 680 | entirely so long as their module's prefixed name matches that of its | ||
| 681 | defining library and the latter's provided feature. | ||
| 682 | |||
| 683 | Packages have also been seen to specify unnecessary top-level | ||
| 684 | @code{eval-after-load} forms, which end up being ineffective in most | ||
| 685 | cases. Another unfortunate practice is mutating @code{erc-modules} | ||
| 686 | itself in an autoloaded form. Doing this tricks Customize into | ||
| 687 | displaying the widget for @code{erc-modules} incorrectly, with | ||
| 688 | built-in modules moved from the predefined checklist to the | ||
| 689 | user-provided free-form area. | ||
| 690 | |||
| 656 | @c PRE5_4: Document every option of every module in its own subnode | 691 | @c PRE5_4: Document every option of every module in its own subnode |
| 657 | 692 | ||
| 658 | 693 | ||