diff options
| author | F. Jason Park | 2023-06-29 07:12:46 -0700 |
|---|---|---|
| committer | F. Jason Park | 2023-07-13 18:45:31 -0700 |
| commit | 80e5e9ddc8d76993fa44a659307174b778aa60b7 (patch) | |
| tree | 4ade822e8b20c50291dd81ac3acffc927544af83 /doc | |
| parent | 08515350faff03e4206e7ed4dfacffc55a4779cd (diff) | |
| download | emacs-80e5e9ddc8d76993fa44a659307174b778aa60b7.tar.gz emacs-80e5e9ddc8d76993fa44a659307174b778aa60b7.zip | |
Improve walkthrough and sample config in ERC manual
* doc/misc/erc.texi: Improve "Sample Session" and "Sample
Configuration" sections. Move introductory paragraph detailing the
history of official GNU IRC channels to the "History" chapter (from
"Sample Sessoin"), and leave a link in its place. Silence strange
warning in "Getting Help and Reporting Bugs" about lack of punctuation
after xref.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/misc/erc.texi | 467 |
1 files changed, 352 insertions, 115 deletions
diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi index d59c6d8a6c6..63ea94d9b2e 100644 --- a/doc/misc/erc.texi +++ b/doc/misc/erc.texi | |||
| @@ -144,11 +144,11 @@ the @samp{#emacs} channels where you can chat with other Emacs users, | |||
| 144 | and if you're having trouble with ERC, you can join the @samp{#erc} | 144 | and if you're having trouble with ERC, you can join the @samp{#erc} |
| 145 | channel and ask for help there. | 145 | channel and ask for help there. |
| 146 | 146 | ||
| 147 | If you want to place ERC settings in their own file, you can place them | 147 | At some point in your ERC journey, you'll inevitably want to change |
| 148 | in @file{~/.emacs.d/.ercrc.el}, creating it if necessary. | 148 | how the client looks and behaves. As with other Emacs applications, |
| 149 | 149 | the typical place to store your settings is your @file{init.el}. If | |
| 150 | If you would rather use the Customize interface to change how ERC | 150 | you would rather use the Customize interface, a good place to start is |
| 151 | works, do @kbd{M-x customize-group @key{RET} erc @key{RET}}. In | 151 | by running @kbd{M-x customize-group @key{RET} erc @key{RET}}. In |
| 152 | particular, ERC comes with lots of modules that may be enabled or | 152 | particular, ERC comes with lots of modules that may be enabled or |
| 153 | disabled; to select which ones you want, do @kbd{M-x | 153 | disabled; to select which ones you want, do @kbd{M-x |
| 154 | customize-variable @key{RET} erc-modules @key{RET}}. | 154 | customize-variable @key{RET} erc-modules @key{RET}}. |
| @@ -161,69 +161,90 @@ customize-variable @key{RET} erc-modules @key{RET}}. | |||
| 161 | @node Sample Session | 161 | @node Sample Session |
| 162 | @section Sample Session | 162 | @section Sample Session |
| 163 | 163 | ||
| 164 | This is an example ERC session which shows how to connect to the | 164 | This example ERC session describes how to connect to the @samp{#emacs} |
| 165 | @samp{#emacs} channel on Libera.Chat. Another IRC channel on | 165 | channel on Libera.Chat. Also worth checking out is Libera's own |
| 166 | Libera.Chat that may be of interest is @samp{#erc}, which is a channel | 166 | introductory guide to IRC, @uref{https://libera.chat/guides/basics}, |
| 167 | where ERC users and developers hang out. These channels used to live | 167 | which presents a more comprehensive overview without instructions |
| 168 | on the Freenode IRC network until June 2021, when they---along with | 168 | specific to ERC. |
| 169 | the official IRC channels of the GNU Project, the Free Software | ||
| 170 | Foundation, and many other free software communities---relocated to | ||
| 171 | the Libera.Chat network in the aftermath of changes in governance and | ||
| 172 | policies of Freenode in May and June 2021. GNU and FSF's | ||
| 173 | announcements about this are at | ||
| 174 | @uref{https://lists.gnu.org/archive/html/info-gnu/2021-06/msg00005.html}, | ||
| 175 | @uref{https://lists.gnu.org/archive/html/info-gnu/2021-06/msg00007.html}, | ||
| 176 | and | ||
| 177 | @uref{https://lists.gnu.org/archive/html/info-gnu-emacs/2021-06/msg00000.html}. | ||
| 178 | 169 | ||
| 179 | @itemize @bullet | 170 | @itemize @bullet |
| 180 | 171 | ||
| 181 | @item Connect to Libera.Chat | 172 | @item Connect to Libera.Chat |
| 182 | 173 | ||
| 183 | Run @kbd{M-x erc}. Use ``irc.libera.chat'' as the IRC server, ``6667'' | 174 | Run @kbd{M-x erc @key{RET}}. Use @samp{irc.libera.chat} for the |
| 184 | as the port, and choose a nickname. | 175 | server and @samp{6667} for the port. Choose a nickname, and hit |
| 176 | @key{y} when asked if you'd prefer to connect over @acronym{TLS}. | ||
| 185 | 177 | ||
| 186 | @item Get used to the interface | 178 | @item Get used to the interface |
| 187 | 179 | ||
| 188 | Switch to the ``irc.libera.chat:6667'' buffer, if you're not already | 180 | Switch to the @file{Libera.Chat} buffer if you're not already there. |
| 189 | there. You will see first some messages about checking for ident, and | 181 | ERC calls this a @dfn{server buffer}, and it must exist for the |
| 190 | then a bunch of other messages that describe the current IRC server. | 182 | duration of the session. You will likely see some messages about |
| 183 | ``ident'', authentication, and the like, followed by information | ||
| 184 | describing the current server and the network. | ||
| 191 | 185 | ||
| 192 | @item Join the #emacs channel | 186 | @item Join the #emacs channel |
| 193 | 187 | ||
| 194 | In that buffer, type ``/join @key{SPC} #emacs'' and hit @kbd{RET}. Depending | 188 | In the server buffer, type @kbd{/join #emacs @key{RET}} at the prompt. |
| 195 | on how you've set up ERC, either a new buffer for ``#emacs'' will be | 189 | ERC will create a new buffer called @file{#emacs}. If you've already |
| 196 | displayed, or a new buffer called ``#emacs'' will be created in the | 190 | configured ERC, you may need to switch to it manually. Once there, |
| 197 | background. If the latter, switch to the ``#emacs'' buffer. You will | 191 | you will see the channel's ``topic'' in the buffer's header line |
| 198 | see the channel topic and a list of the people who are currently on the | 192 | (@pxref{Header Lines,,,elisp,}) and a list of people currently in the |
| 199 | channel. | 193 | channel. If you can't see the full topic, mouse over it or type |
| 194 | @kbd{/topic @key{RET}} at the prompt. | ||
| 200 | 195 | ||
| 201 | @item Register your nickname with Libera.Chat | 196 | @item Register your nickname with Libera.Chat |
| 202 | 197 | ||
| 203 | If you would like to be able to talk with people privately on the | 198 | In order to access essential network features, like speaking in |
| 204 | Libera.Chat network, you will have to ``register'' your nickname. | 199 | certain channels and participating in private conversations, you'll |
| 205 | To do so, switch to the ``irc.libera.chat:6667'' buffer and type | 200 | likely have to ``register'' your nickname. To do so, switch to the |
| 206 | ``/msg NickServ register <password>'', replacing ``<password>'' with | 201 | @file{Libera.Chat} buffer and type @kbd{/msg NickServ register |
| 207 | your desired password. It should tell you that the operation was | 202 | @samp{<password>} @samp{<email>} @key{RET}}, replacing |
| 208 | successful. | 203 | @samp{<password>} and @samp{<email>} with your desired account |
| 204 | password and contact email (both sans quotes). The server should tell | ||
| 205 | you that the operation was successful. See the official Libera.Chat | ||
| 206 | docs if you encounter problems. | ||
| 207 | |||
| 208 | In addition to creating an account, this process also | ||
| 209 | ``authenticates'' you to the network's ``account services'' system for | ||
| 210 | the duration of the session. In other words, you're now logged in. | ||
| 211 | However, when you connect in the future, you'll need to authenticate | ||
| 212 | again by providing the same credentials somehow. When you're finished | ||
| 213 | with this walk through, see ``Next Steps'', below, to learn some ways | ||
| 214 | to do that. | ||
| 209 | 215 | ||
| 210 | @item Talk to people in the channel | 216 | @item Talk to people in the channel |
| 211 | 217 | ||
| 212 | If you switch back to the ``#emacs'' buffer, you can type a message, and | 218 | Switch back to the @file{#emacs} buffer and type a message at the |
| 213 | everyone on the channel will see it. | 219 | prompt, hitting @kbd{RET} once satisfied. Everyone in the channel |
| 220 | will now see your message. | ||
| 214 | 221 | ||
| 215 | @item Open a query buffer to talk to someone | 222 | @item Open a query buffer to talk to someone |
| 216 | 223 | ||
| 217 | If you want to talk with someone in private (this should usually not be | 224 | If you want to talk with someone in private, type @kbd{/query |
| 218 | done for technical help, only for personal questions), type ``/query | 225 | @samp{<nick>} @key{RET}}, replacing @samp{<nick>} with the their |
| 219 | <nick>'', replacing ``<nick>'' with the nickname of the person you would | 226 | nickname. As before, with the server buffer, if this new @dfn{query |
| 220 | like to talk to. Depending on how ERC is set up, you will either see a | 227 | buffer} doesn't appear in the current window, you may have to switch |
| 221 | new buffer with the name of the person, or such a buffer will be created | 228 | to it. Regardless, its name should match @samp{<nick>}. Once there, |
| 222 | in the background and you will have to switch to it. Begin typing | 229 | type something at the prompt and hit @kbd{RET}, and the other party |
| 223 | messages, and you will be able to have a conversation. | 230 | will see it. |
| 224 | 231 | ||
| 225 | Note that if the other person is not registered, you will not be able to | 232 | Keep in mind that if either party isn't authenticated, you may not be |
| 226 | talk with them. | 233 | able to converse at all. Also, depending on the network, certain |
| 234 | social conventions may apply to the practice of direct messaging. As | ||
| 235 | a general rule, queries should usually be reserved for personal | ||
| 236 | matters rather than technical help, which can often benefit (and | ||
| 237 | benefit @emph{from}) a larger audience. | ||
| 238 | |||
| 239 | @item Next steps | ||
| 240 | |||
| 241 | Try joining another channel, such as @samp{#erc}, where ERC users and | ||
| 242 | developers hang out (@pxref{Official IRC channels} for more on the | ||
| 243 | history of @samp{#emacs}). For ideas on various options to customize, | ||
| 244 | @pxref{Sample Configuration}. To learn how ERC can authenticate you | ||
| 245 | to the network automatically whenever you connect, @pxref{SASL}. As | ||
| 246 | always, if you encounter problems, @pxref{Getting Help and Reporting | ||
| 247 | Bugs}. | ||
| 227 | 248 | ||
| 228 | @end itemize | 249 | @end itemize |
| 229 | 250 | ||
| @@ -1192,76 +1213,277 @@ case, you'll probably want to temporarily disable | |||
| 1192 | @section Sample Configuration | 1213 | @section Sample Configuration |
| 1193 | @cindex configuration, sample | 1214 | @cindex configuration, sample |
| 1194 | 1215 | ||
| 1195 | Here is an example of configuration settings for ERC@. This can go into | 1216 | Here is an example configuration for ERC@. @strong{Don't panic} if |
| 1196 | your Emacs configuration file. Everything after the @code{(require | 1217 | you aren't familiar with @samp{use-package} or have no interest in |
| 1197 | 'erc)} command can optionally go into @file{~/.emacs.d/.ercrc.el}. | 1218 | learning it. For our purposes, it's just a means of presenting |
| 1219 | configuration details in a tidy, standardized format. If it helps, | ||
| 1220 | just pretend it's some make-believe, pseudo configuration language. | ||
| 1221 | Although the syntax below is easy enough to intuit and adapt to your | ||
| 1222 | setup, you may wish to keep the following in mind (or @pxref{Top,,, | ||
| 1223 | use-package,}): | ||
| 1224 | |||
| 1225 | @itemize @bullet | ||
| 1226 | @item | ||
| 1227 | Each @code{use-package} ``declaration'' focuses on a library | ||
| 1228 | ``feature'', which is just a symbol you'd normally @code{require} in | ||
| 1229 | your config @pxref{Named Features,,, elisp,}). | ||
| 1230 | |||
| 1231 | @item | ||
| 1232 | Emacs loads anything in a @code{:config} section @emph{after} loading | ||
| 1233 | whatever library @code{provide}s the declaration's feature. | ||
| 1234 | |||
| 1235 | @item | ||
| 1236 | Everything in a @code{:custom} or @code{:custom-face} section is | ||
| 1237 | basically something you'd find in your @code{custom-file}. | ||
| 1238 | @end itemize | ||
| 1239 | |||
| 1240 | @noindent | ||
| 1241 | The following would typically go in your init file. Experienced users | ||
| 1242 | may opt to keep any non-settings, like commands and functions, in a | ||
| 1243 | dedicated @file{~/.emacs.d/.ercrc.el}. Whatever the case, please keep | ||
| 1244 | in mind that you can replace nearly all of the following with Custom | ||
| 1245 | settings (@pxref{Sample configuration via Customize}). | ||
| 1246 | |||
| 1247 | @lisp | ||
| 1248 | ;;; My ERC configuration -*- lexical-binding: t -*- | ||
| 1249 | |||
| 1250 | (use-package erc | ||
| 1251 | :config | ||
| 1252 | ;; Prefer SASL to NickServ, colorize nicknames, interpret mIRC colors, | ||
| 1253 | ;; and list buffers and channel members in separate side panels. | ||
| 1254 | (setopt erc-modules | ||
| 1255 | (seq-union '(sasl nicks irccontrols bufbar nickbar scrolltobottom) | ||
| 1256 | erc-modules)) | ||
| 1257 | |||
| 1258 | :custom | ||
| 1259 | ;; Protect me from accidentally sending excess lines. | ||
| 1260 | (erc-inhibit-multiline-input t) | ||
| 1261 | (erc-send-whitespace-lines t) | ||
| 1262 | (erc-ask-about-multiline-input t) | ||
| 1263 | |||
| 1264 | ;; Reconnect automatically using a fancy strategy. | ||
| 1265 | (erc-server-reconnect-function #'erc-server-delayed-check-reconnect) | ||
| 1266 | (erc-server-reconnect-timeout 30) | ||
| 1267 | |||
| 1268 | ;; Insert a newline when I hit <RET> at the prompt, and prefer | ||
| 1269 | ;; something more deliberate for actually sending messages. | ||
| 1270 | :bind (:map erc-mode-map | ||
| 1271 | ("RET" . nil) | ||
| 1272 | ("C-c C-c" . #'erc-send-current-line)) | ||
| 1273 | |||
| 1274 | ;; Emphasize buttonized text in notices. | ||
| 1275 | :custom-face (erc-notice-face ((t (:slant italic :weight unspecified))))) | ||
| 1276 | |||
| 1277 | (use-package erc-sasl | ||
| 1278 | ;; Since my account name is the same as my nick, free me from having | ||
| 1279 | ;; to hit C-u before M-x erc to trigger a username prompt. | ||
| 1280 | :custom (erc-sasl-user :nick)) | ||
| 1281 | |||
| 1282 | (use-package erc-join | ||
| 1283 | ;; Join #emacs and #erc whenever I connect to Libera.Chat. | ||
| 1284 | :custom (erc-autojoin-channels-alist '((Libera.Chat "#emacs" "#erc")))) | ||
| 1285 | |||
| 1286 | (use-package erc-fill | ||
| 1287 | :custom | ||
| 1288 | ;; Prefer one message per line without continuation indicators. | ||
| 1289 | (erc-fill-function #'erc-fill-wrap) | ||
| 1290 | (erc-fill-static-center 18) | ||
| 1291 | |||
| 1292 | :bind (:map erc-fill-wrap-mode-map ("C-c =" . #'erc-fill-wrap-nudge))) | ||
| 1293 | |||
| 1294 | (use-package erc-track | ||
| 1295 | ;; Prevent JOINs and PARTs from lighting up the mode-line. | ||
| 1296 | :config (setopt erc-track-faces-priority-list | ||
| 1297 | (remq 'erc-notice-face erc-track-faces-priority-list)) | ||
| 1298 | |||
| 1299 | :custom (erc-track-priority-faces-only 'all)) | ||
| 1300 | |||
| 1301 | (use-package erc-goodies | ||
| 1302 | ;; Turn on read indicators when joining channels. | ||
| 1303 | :hook (erc-join . my-erc-enable-read-indicator-on-join)) | ||
| 1304 | |||
| 1305 | (defvar my-erc-read-indicator-channels '("#emacs") | ||
| 1306 | "Channels in which to show a `keep-place-indicator'.") | ||
| 1307 | |||
| 1308 | (defun my-erc-enable-read-indicator-on-join () | ||
| 1309 | "Enable read indicators for certain queries or channels." | ||
| 1310 | (when (member (erc-default-target) my-erc-read-indicator-channels) | ||
| 1311 | (erc-keep-place-indicator-mode +1))) | ||
| 1312 | |||
| 1313 | ;; Handy commands from the Emacs Wiki. | ||
| 1314 | (defun erc-cmd-TRACK (&optional target) | ||
| 1315 | "Start tracking TARGET or that of current buffer." | ||
| 1316 | (setq erc-track-exclude (delete (or target (erc-default-target)) | ||
| 1317 | erc-track-exclude))) | ||
| 1318 | |||
| 1319 | (defun erc-cmd-UNTRACK (&optional target) | ||
| 1320 | "Stop tracking TARGET or that of current buffer." | ||
| 1321 | (setq erc-track-exclude (cl-pushnew (or target (erc-default-target)) | ||
| 1322 | erc-track-exclude | ||
| 1323 | :test #'equal))) | ||
| 1324 | |||
| 1325 | @end lisp | ||
| 1326 | |||
| 1327 | @noindent | ||
| 1328 | Those familiar with @code{use-package} may have noticed the lack of | ||
| 1329 | @code{:defer} keyword args. This was done to conserve space, but you | ||
| 1330 | can just pretend that this user has enabled | ||
| 1331 | @code{use-package-always-defer} elsewhere. | ||
| 1332 | |||
| 1333 | @anchor{Sample configuration via Customize} | ||
| 1334 | @subheading Via Customize | ||
| 1335 | @cindex configuration, via customize | ||
| 1336 | |||
| 1337 | As mentioned, Customize users can accomplish nearly all of the above | ||
| 1338 | via the Customize interface. Start by running @kbd{M-x | ||
| 1339 | customize-group @key{RET} erc @key{RET}}, and search for ``Modules'' | ||
| 1340 | with @kbd{C-s modules @key{RET}}. Toggle open the flyout menu to | ||
| 1341 | reveal the full ``widget'' panel, a web-form-like interface for ``Erc | ||
| 1342 | Modules''. Tick the boxes for @samp{bufbar}, @samp{irccontrols}, | ||
| 1343 | @samp{nickbar}, @samp{nicks}, @samp{sasl}, and @samp{scrolltobottom}. | ||
| 1344 | |||
| 1345 | Next, search for the phrases ``Erc Ask About Multiline Input'', ``Erc | ||
| 1346 | Inhibit Mulitline Input'', and ``Erc Send Whitespace Lines''. These | ||
| 1347 | are the print names of three Boolean options that control how ERC | ||
| 1348 | treats prompt input containing line breaks. When visiting each | ||
| 1349 | option's section, twirl open its triangle icon to reveal its widget | ||
| 1350 | UI, and click its @samp{[Toggle]} button to set its value to @code{t}. | ||
| 1351 | While going about this, you may find it helpful to glance at the | ||
| 1352 | descriptions just in case you want to disable them later. When | ||
| 1353 | finished, hit @kbd{C-x C-s} or click @samp{[Apply and Save]} atop the | ||
| 1354 | buffer. | ||
| 1355 | |||
| 1356 | Now do the same for another couple options, this time having to do | ||
| 1357 | with automatic reconnection. But instead of searching for their print | ||
| 1358 | names, try running @kbd{M-x customize-option @key{RET} @samp{<option>} | ||
| 1359 | @key{RET}}, replacing @samp{<option>} with: | ||
| 1360 | |||
| 1361 | @itemize @bullet | ||
| 1362 | @item @code{erc-server-reconnect-function}, a function | ||
| 1363 | @item @code{erc-server-reconnect-timeout}, a number | ||
| 1364 | @end itemize | ||
| 1365 | |||
| 1366 | @noindent | ||
| 1367 | (If it helps, hit @key{TAB} for completion.) As you may have noticed, | ||
| 1368 | when customizing options individually, each buffer displays but a | ||
| 1369 | single option's widget. When you get to the buffer for ``Erc Server | ||
| 1370 | Reconnect Function'', you'll see that @samp{[Toggle]} has been | ||
| 1371 | replaced with @samp{[Value Menu]} and that clicking it reveals three | ||
| 1372 | choices in a pop-up window. Enter @kbd{1} to select | ||
| 1373 | @code{erc-server-delayed-check-reconnect} before @key{TAB}'ing over to | ||
| 1374 | @samp{[State]} and hitting @key{RET}. Enter @kbd{1} again, this time | ||
| 1375 | to persists your changes. | ||
| 1376 | |||
| 1377 | For the final option, @code{erc-server-reconnect-timeout}, you'll | ||
| 1378 | encounter a text field (instead of a button), which works like those | ||
| 1379 | in a typical web form. Enter @samp{30} and hit @kbd{C-x C-s} to save. | ||
| 1380 | Just for fun, click the group link for @samp{Erc Server} at the bottom | ||
| 1381 | of the buffer. You could just as well have set the last two options | ||
| 1382 | from this ``custom group'' buffer alone, which very much resembles the | ||
| 1383 | one for the @samp{Erc} group, which is actually the ``parent'' of this | ||
| 1384 | group (note the ``breadcrumb'' for group @samp{Erc} atop the buffer). | ||
| 1385 | Indeed, you can always get back here by running @kbd{M-x | ||
| 1386 | customize-group @key{RET} erc-server @key{RET}} from almost anywhere | ||
| 1387 | in Emacs. | ||
| 1388 | |||
| 1389 | Now it's time to set some key bindings for @code{erc-mode-map}, a | ||
| 1390 | major-mode keymap active in all ERC buffers. In general, it's best to | ||
| 1391 | do this part either entirely or in conjunction with some lisp code in | ||
| 1392 | you init file. However, to keep things ``simple'', we'll do it all in | ||
| 1393 | customization buffers. To get started, hit @kbd{M-x customize-group | ||
| 1394 | @key{RET} erc-hooks @key{RET}} and search for ``Erc Mode Hook''. In | ||
| 1395 | the widget form, click @samp{[INS]}, and paste the following into the | ||
| 1396 | value field in place of the default text. | ||
| 1397 | |||
| 1398 | @lisp | ||
| 1399 | (lambda () | ||
| 1400 | (keymap-set erc-mode-map "RET" nil) | ||
| 1401 | (keymap-set erc-mode-map "C-c C-c" 'erc-send-current-line)) | ||
| 1402 | @end lisp | ||
| 1403 | |||
| 1404 | @noindent | ||
| 1405 | Don't worry about the line breaks. Emacs is smart enough to handle | ||
| 1406 | those. When you're ready, click @samp{[Apply and Save]}. | ||
| 1407 | |||
| 1408 | Next, try tweaking the face ERC uses to stylize server messages that | ||
| 1409 | say things like ``SoAndSo has joined channel #chan''. Type @kbd{M-x | ||
| 1410 | customize-face @key{RET} erc-notice-face @key{RET}}. Click the | ||
| 1411 | ``link''-looking button at the very bottom that says something like | ||
| 1412 | ``Show All Attributes''. Untick @samp{Weight} and tick @samp{Slant}. | ||
| 1413 | Then, in the latter's @samp{[Value Menu]}, enter @samp{0} for | ||
| 1414 | @samp{italic}. Hit @kbd{C-x C-s} to save. | ||
| 1415 | |||
| 1416 | Time for some more involved configuring. From now on, if something | ||
| 1417 | isn't applicable to your setup, just skip ahead. Also, note that if | ||
| 1418 | you've installed ERC from GNU ELPA, you may need to load libraries for | ||
| 1419 | groups and options you'd like to customize before Emacs can create a | ||
| 1420 | customization buffer. For example, to do this for the group | ||
| 1421 | @code{erc-sasl}, run @kbd{M-: (require 'erc-sasl) @key{RET}}. | ||
| 1422 | |||
| 1423 | Speaking of @acronym{SASL}, those already authenticating with it may | ||
| 1424 | have noticed that connecting interactively requires running @kbd{C-u | ||
| 1425 | M-x erc-tls @key{RET}} in order to receive a ``User'' prompt for your | ||
| 1426 | account name. However, if your nickname happens to be the same as | ||
| 1427 | your account name, you can avoid the leading @kbd{C-u} by customizing | ||
| 1428 | the option @code{erc-sasl-user} to the keyword symbol @code{:nick}. | ||
| 1429 | At the time of writing, you'd hit @kbd{2} when prompted by the | ||
| 1430 | option's @samp{[Value menu]}. Hit @kbd{C-x C-s} to save your changes. | ||
| 1431 | |||
| 1432 | One of ERC's most configured options lives in @file{erc-join}, and it | ||
| 1433 | determines the channels you join upon connecting. To make it work for | ||
| 1434 | you, customize the option @code{erc-autojoin-channels-alist}. In the | ||
| 1435 | customization widget, hit @samp{[INS]} to create a new entry. In the | ||
| 1436 | @samp{Network:} field, type @samp{Libera.Chat}. Under | ||
| 1437 | @samp{Channels:}, hit @samp{[INS]} again, this time to create a field | ||
| 1438 | to enter a channel name, and enter @samp{#emacs}. Now, find and click | ||
| 1439 | on the lowermost @samp{[INS]}, and this time enter @samp{#erc} in the | ||
| 1440 | @samp{Name:} field. Save your changes. | ||
| 1441 | |||
| 1442 | If you're new to ERC, you may not be familiar with the various ways it | ||
| 1443 | can ``fill'' message text by inserting line breaks. The most modern | ||
| 1444 | fill style is called @code{fill-wrap}, and it's available by | ||
| 1445 | customizing @code{erc-fill-function} to @code{erc-fill-wrap}, which | ||
| 1446 | appears as @samp{Dynamic word-wrap} in the option's @samp{[Value | ||
| 1447 | Menu]}. After setting this, change the related option | ||
| 1448 | @code{erc-fill-static-center} to the integer @samp{18}. Save your | ||
| 1449 | changes. As a bonus exercise, try binding the key @kbd{C-c =} to the | ||
| 1450 | function @code{erc-fill-wrap-nudge} in the minor-mode keymap | ||
| 1451 | @code{erc-fill-wrap-mode-map} (hint: the minor mode's hook is called | ||
| 1452 | @code{erc-fill-wrap-mode-hook}, and it's not a member of any | ||
| 1453 | customization group). | ||
| 1454 | |||
| 1455 | ERC users tend to be picky about the mode line. If you find that | ||
| 1456 | you'd rather not see changes when people join and leave channels, | ||
| 1457 | customize the option @code{erc-track-faces-priority-list}. When | ||
| 1458 | visiting its customization buffer, you'll notice it's quite busy. | ||
| 1459 | Ignore everything and type @kbd{C-s erc-notice-face @key{RET}}. Click | ||
| 1460 | the @samp{[DEL]} button at the beginning of the line you end up on, | ||
| 1461 | and save your changes. Next, customize the related option | ||
| 1462 | @code{erc-track-priority-faces-only} to the @samp{[Value Menu]} choice | ||
| 1463 | @samp{all}. Once again, save your changes. | ||
| 1464 | |||
| 1465 | Let's say you'd like to enable a ``local module'' (ERC's version of a | ||
| 1466 | local minor mode) in a specific channel. One way to do that is by | ||
| 1467 | running some code to activate the module if the channel's name | ||
| 1468 | matches. Try that now by customizing the option @code{erc-join-hook}. | ||
| 1469 | Add the following in the value field before saving your changes: | ||
| 1198 | 1470 | ||
| 1199 | @lisp | 1471 | @lisp |
| 1200 | ;;; Sample ERC configuration | 1472 | (lambda () |
| 1201 | 1473 | (require 'erc-goodies) | |
| 1202 | ;; Load authentication info from an external source. Put sensitive | 1474 | (when (equal (erc-default-target) "#emacs") |
| 1203 | ;; passwords and the like in here. | 1475 | (erc-keep-place-indicator-mode +1))) |
| 1204 | (load "~/.emacs.d/.erc-auth") | ||
| 1205 | |||
| 1206 | ;; This is an example of how to make a new command. Type "/uptime" to | ||
| 1207 | ;; use it. | ||
| 1208 | (defun erc-cmd-UPTIME (&rest ignore) | ||
| 1209 | "Display the uptime of the system, as well as some load-related | ||
| 1210 | stuff, to the current ERC buffer." | ||
| 1211 | (let ((uname-output | ||
| 1212 | (replace-regexp-in-string | ||
| 1213 | ", load average: " "] @{Load average@} [" | ||
| 1214 | ;; Collapse spaces, remove | ||
| 1215 | (replace-regexp-in-string | ||
| 1216 | " +" " " | ||
| 1217 | ;; Remove beginning and trailing whitespace | ||
| 1218 | (replace-regexp-in-string | ||
| 1219 | "^ +\\|[ \n]+$" "" | ||
| 1220 | (shell-command-to-string "uptime")))))) | ||
| 1221 | (erc-send-message | ||
| 1222 | (concat "@{Uptime@} [" uname-output "]")))) | ||
| 1223 | |||
| 1224 | ;; This causes ERC to connect to the Libera.Chat network upon hitting | ||
| 1225 | ;; C-c e f. Replace MYNICK with your IRC nick. | ||
| 1226 | (global-set-key "\C-cef" (lambda () (interactive) | ||
| 1227 | (erc :server "irc.libera.chat" :port "6667" | ||
| 1228 | :nick "MYNICK"))) | ||
| 1229 | |||
| 1230 | ;; This causes ERC to connect to the IRC server on your own machine (if | ||
| 1231 | ;; you have one) upon hitting C-c e b. Replace MYNICK with your IRC | ||
| 1232 | ;; nick. Often, people like to run bitlbee (https://bitlbee.org/) as an | ||
| 1233 | ;; AIM/Jabber/MSN to IRC gateway, so that they can use ERC to chat with | ||
| 1234 | ;; people on those networks. | ||
| 1235 | (global-set-key "\C-ceb" (lambda () (interactive) | ||
| 1236 | (erc :server "localhost" :port "6667" | ||
| 1237 | :nick "MYNICK"))) | ||
| 1238 | |||
| 1239 | ;; Make C-c RET (or C-c C-RET) send messages instead of RET. This has | ||
| 1240 | ;; been commented out to avoid confusing new users. | ||
| 1241 | ;; (define-key erc-mode-map (kbd "RET") nil) | ||
| 1242 | ;; (define-key erc-mode-map (kbd "C-c RET") 'erc-send-current-line) | ||
| 1243 | ;; (define-key erc-mode-map (kbd "C-c C-RET") 'erc-send-current-line) | ||
| 1244 | |||
| 1245 | ;;; Options | ||
| 1246 | |||
| 1247 | ;; Join the #emacs and #erc channels whenever connecting to | ||
| 1248 | ;; Libera.Chat. | ||
| 1249 | (setq erc-autojoin-channels-alist | ||
| 1250 | '(("Libera.Chat" "#emacs" "#erc"))) | ||
| 1251 | |||
| 1252 | ;; Interpret mIRC-style color commands in IRC chats | ||
| 1253 | (setq erc-interpret-mirc-color t) | ||
| 1254 | |||
| 1255 | ;; The following are commented out by default, but users of other | ||
| 1256 | ;; non-Emacs IRC clients might find them useful. | ||
| 1257 | ;; Kill buffers for channels after /part | ||
| 1258 | ;; (setq erc-kill-buffer-on-part t) | ||
| 1259 | ;; Kill buffers for private queries after quitting the server | ||
| 1260 | ;; (setq erc-kill-queries-on-quit t) | ||
| 1261 | ;; Kill buffers for server messages after quitting the server | ||
| 1262 | ;; (setq erc-kill-server-buffer-on-quit t) | ||
| 1263 | @end lisp | 1476 | @end lisp |
| 1264 | 1477 | ||
| 1478 | Lastly, if you really want the two ``slash'' commands defined at the | ||
| 1479 | end of the previous section, you can put them in any file listed in | ||
| 1480 | @code{erc-startup-file-list}, such as @file{~/.emacs.d/.ercrc.el}. | ||
| 1481 | Make sure to put @code{(require 'erc-track)} near the top of the file. | ||
| 1482 | These will allow you to type @kbd{/TRACK @key{RET}} and @kbd{/UNTRACK | ||
| 1483 | @key{RET}} in channels and query buffers to tell ERC whether to show | ||
| 1484 | activity from these buffers in the mode line. | ||
| 1485 | |||
| 1486 | |||
| 1265 | @node Integrations | 1487 | @node Integrations |
| 1266 | @section Integrations | 1488 | @section Integrations |
| 1267 | @cindex integrations | 1489 | @cindex integrations |
| @@ -1777,7 +1999,7 @@ In the resulting @code{help-mode} buffer, confirm the version and | |||
| 1777 | click @samp{Install}. Make sure to restart Emacs before reconnecting | 1999 | click @samp{Install}. Make sure to restart Emacs before reconnecting |
| 1778 | to IRC, and don't forget that you can roll back to the previous | 2000 | to IRC, and don't forget that you can roll back to the previous |
| 1779 | version by running @kbd{M-x package-delete @key{RET}}. | 2001 | version by running @kbd{M-x package-delete @key{RET}}. |
| 1780 | @xref{Packages,,,emacs, the Emacs manual} for more information. | 2002 | @xref{Packages,,,emacs, The Emacs Editor}, for more information. |
| 1781 | 2003 | ||
| 1782 | In the rare instance you need an emergency fix or have volunteered to | 2004 | In the rare instance you need an emergency fix or have volunteered to |
| 1783 | test an edge feature between ERC releases, you can try adding | 2005 | test an edge feature between ERC releases, you can try adding |
| @@ -1866,6 +2088,21 @@ is maintained as part of Emacs. | |||
| 1866 | 2088 | ||
| 1867 | @end itemize | 2089 | @end itemize |
| 1868 | 2090 | ||
| 2091 | @anchor{Official IRC channels} | ||
| 2092 | @subheading Official IRC channels | ||
| 2093 | @cindex official IRC channels | ||
| 2094 | |||
| 2095 | The official channels for GNU Emacs and ERC lived on the Freenode IRC | ||
| 2096 | network until June 2021, when they---along with the official IRC | ||
| 2097 | channels of the GNU Project, the Free Software Foundation, and many | ||
| 2098 | other free software communities---relocated to the Libera.Chat network | ||
| 2099 | in the aftermath of changes in governance and policies of Freenode in | ||
| 2100 | May and June 2021. GNU and FSF's announcements about this are at | ||
| 2101 | @uref{https://lists.gnu.org/archive/html/info-gnu/2021-06/msg00005.html}, | ||
| 2102 | @uref{https://lists.gnu.org/archive/html/info-gnu/2021-06/msg00007.html}, | ||
| 2103 | and | ||
| 2104 | @uref{https://lists.gnu.org/archive/html/info-gnu-emacs/2021-06/msg00000.html}. | ||
| 2105 | |||
| 1869 | @node GNU Free Documentation License | 2106 | @node GNU Free Documentation License |
| 1870 | @appendix GNU Free Documentation License | 2107 | @appendix GNU Free Documentation License |
| 1871 | @include doclicense.texi | 2108 | @include doclicense.texi |