4 Modules

One way to add functionality to ERC is to customize which of its many modules are loaded.

There is a spiffy customize interface, which may be reached by typing M-x customize-option RET erc-modules RET. When removing a module outside of the Custom ecosystem, you may wish to ensure it’s disabled by invoking its associated minor-mode toggle with a nonpositive prefix argument, for example, C-u - M-x erc-spelling-mode RET. Additionally, if you plan on loading third-party modules that perform atypical setup on activation, you may need to arrange for calling erc-update-modules in your init file. Examples of such setup might include registering an erc-before-connect hook, advising erc-open, and modifying erc-modules itself.

The following is a list of available modules.

autoaway

Set away status automatically

autojoin

Join channels automatically

bbdb

Integrate with the Big Brother Database

button

Buttonize URLs, nicknames, and other text

capab-identify

Mark unidentified users on freenode and other servers supporting CAPAB.

completion (aka pcomplete)

Complete nicknames and commands (programmable)

fill

Wrap long lines

identd

Launch an identd server on port 8113

irccontrols

Highlight or remove IRC control characters

log

Save buffers in logs

match

Highlight pals, fools, and other keywords

menu

Display a menu in ERC buffers

netsplit

Detect netsplits

noncommands

Don’t display non-IRC commands after evaluation

notify

Notify when the online status of certain users changes

notifications

Send you a notification when you get a private message, or your nickname is mentioned

page

Process CTCP PAGE requests from IRC

readonly

Make displayed lines read-only

replace

Replace text in messages

ring

Enable an input history

sasl

Enable SASL authentication

scrolltobottom

Scroll to the bottom of the buffer

services

Identify to Nickserv (IRC Services) automatically

smiley

Convert smileys to pretty icons

sound

Play sounds when you receive CTCP SOUND requests

spelling

Check spelling of messages

stamp

Add timestamps to messages

track

Track channel activity in the mode-line

truncate

Truncate buffers to a certain size

unmorse

Translate morse code in messages

Required Modules

Note that some modules are essential to core IRC operations and thus not listed above. You can nevertheless still remove these, but doing so demands special precautions to avoid degrading the user experience. At present, the only such module is networks, whose library ERC always loads anyway.

Local Modules

All modules operate as minor modes under the hood, and some newer ones may be defined as buffer-local. These so-called “local modules” are a work in progress and their behavior and interface are subject to change. As of ERC 5.5, the only practical differences are as follows:

  1. “Control variables,” like erc-sasl-mode, retain their values across IRC sessions and override erc-module membership when influencing module activation.
  2. Removing a local module from erc-modules via Customize not only disables its mode but also kills its control variable in all ERC buffers.
  3. “Mode toggles,” like erc-sasl-mode and the complementary erc-sasl-enable/erc-sasl-disable pairing, behave differently than their global counterparts.

In target buffers, a local module’s activation state survives “reassociation” by default, but modules themselves always have the final say. For example, a module may reset all instances of itself in its network context upon reconnecting. Moreover, the value of a mode variable may be meaningless in buffers that its module has no interest in. For example, the value of erc-sasl-mode doesn’t matter in target buffers and may even remain non-nil after SASL has been disabled for the current connection (and vice versa).

When it comes to server buffers, a module’s activation state only persists for sessions revived via the automatic reconnection mechanism or a manual ‘/reconnect’ issued at the prompt. In other words, this doesn’t apply to sessions revived by an entry-point command, such as erc-tls, because such commands always ensure a clean slate by looking only to erc-modules. Although a session revived in this manner may indeed harvest other information from a previous server buffer, it simply doesn’t care which modules might have been active during that connection.

Lastly, a local mode’s toggle command, like erc-sasl-mode, only affects the current buffer, but its “non-mode” cousins, like erc-sasl-enable and erc-sasl-disable, operate on all buffers belonging to their connection (when called interactively). And unlike global toggles, none of these ever mutates erc-modules.