Commit | Line | Data |
---|---|---|
97ed0ac3 EZ |
1 | \input texinfo |
2 | @c %**start of header | |
3 | @setfilename ../info/rcirc | |
4 | @settitle rcirc Manual | |
5 | @c %**end of header | |
6 | ||
7 | @copying | |
4e6835db | 8 | Copyright @copyright{} 2006, 2007 Free Software Foundation, Inc. |
97ed0ac3 EZ |
9 | |
10 | @quotation | |
11 | Permission is granted to copy, distribute and/or modify this document | |
12 | under the terms of the GNU Free Documentation License, Version 1.2 or | |
13 | any later version published by the Free Software Foundation; with no | |
14 | Invariant Sections, with the Front-Cover texts being ``A GNU Manual'', | |
15 | and with the Back-Cover Texts as in (a) below. A copy of the license is | |
16 | included in the section entitled ``GNU Free Documentation License'' in | |
17 | the Emacs manual. | |
18 | ||
19 | (a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify | |
20 | this GNU Manual, like GNU software. Copies published by the Free | |
21 | Software Foundation raise funds for GNU development.'' | |
22 | ||
23 | This document is part of a collection distributed under the GNU Free | |
24 | Documentation License. If you want to distribute this document | |
25 | separately from the collection, you can do so by adding a copy of the | |
26 | license to the document, as described in section 6 of the license. | |
27 | @end quotation | |
28 | @end copying | |
29 | ||
30 | @dircategory Emacs | |
31 | @direntry | |
62e77f3d | 32 | * Rcirc: (rcirc). Internet Relay Chat (IRC) client. |
97ed0ac3 EZ |
33 | @end direntry |
34 | ||
35 | @titlepage | |
36 | @title rcirc Manual | |
37 | @page | |
38 | @vskip 0pt plus 1filll | |
39 | @insertcopying | |
40 | @end titlepage | |
41 | ||
42 | @ifnottex | |
43 | @node Top, Basics, (dir), (dir) | |
44 | @top rcirc Manual | |
45 | @end ifnottex | |
46 | ||
47 | @code{rcirc} is an Emacs IRC client. | |
48 | ||
49 | IRC (Internet Relay Chat) is a multi-user chat protocol. Users | |
50 | communicate with each other in real-time. Communication occurs both in | |
51 | topic channels which are collections of many users, or privately, with | |
52 | just one other user. | |
53 | ||
54 | @menu | |
62e77f3d LT |
55 | * Basics:: |
56 | * Reference:: | |
57 | * Hacking and Tweaking:: | |
58 | * Key Index:: | |
59 | * Variable Index:: | |
60 | * Index:: | |
97ed0ac3 EZ |
61 | |
62 | @detailmenu | |
63 | --- The Detailed Node Listing --- | |
64 | ||
65 | Basics | |
66 | ||
67 | * Internet Relay Chat:: | |
68 | * Getting started with rcirc:: | |
69 | ||
70 | Reference | |
71 | ||
72 | * rcirc commands:: | |
73 | * Useful IRC commands:: | |
74 | * Configuration:: | |
75 | ||
76 | Hacking and Tweaking | |
77 | ||
78 | * Skipping /away messages using handlers:: | |
79 | * Using fly spell mode:: | |
80 | * Scrolling conservatively:: | |
81 | * Changing the time stamp format:: | |
82 | * Defining a new command:: | |
83 | * Reconnecting after you have lost the connection:: | |
84 | ||
85 | @end detailmenu | |
86 | @end menu | |
87 | ||
88 | @node Basics, Reference, Top, Top | |
89 | @chapter Basics | |
97ed0ac3 EZ |
90 | |
91 | This chapter contains a brief introduction to IRC (Internet Relay Chat), | |
92 | and a quick tutorial on @code{rcirc}. | |
93 | ||
94 | @menu | |
62e77f3d LT |
95 | * Internet Relay Chat:: |
96 | * Getting started with rcirc:: | |
97ed0ac3 EZ |
97 | @end menu |
98 | ||
99 | @node Internet Relay Chat, Getting started with rcirc, Basics, Basics | |
100 | @section Internet Relay Chat | |
101 | @cindex internet relay chat | |
102 | @cindex irc | |
103 | ||
104 | @cindex channel | |
105 | @dfn{Internet Relay Chat} (IRC) is a form of instant communication over the | |
106 | Internet. It is mainly designed for group (many-to-many) communication | |
107 | in discussion forums called channels, but also allows one-to-one | |
108 | communication. | |
109 | ||
110 | @cindex instant messaging, comparison | |
111 | @cindex server | |
112 | @cindex network | |
113 | Contrary to most Instant Messenger (IM) systems, users usually don't | |
114 | connect to a central server. Instead, users connect to a random server | |
115 | in a network, and the servers share information between them. | |
116 | ||
117 | Here's a typical example: | |
118 | ||
119 | @cindex redirection to random servers | |
120 | When you connect to the Freenode network | |
b4a349d1 | 121 | (@code{http://freenode.net/}), you point your IRC client at the |
97ed0ac3 EZ |
122 | server @code{irc.freenode.net}. That server will redirect your client |
123 | to a random server on the network, such as @code{zelazny.freenode.net}. | |
124 | ||
d177d64e | 125 | @cindex channel name |
97ed0ac3 EZ |
126 | @cindex # starts a channel name |
127 | Once you're connected, you can send messages to all other users | |
128 | connected to the same network, and you can join all channels on the same | |
129 | network. You might join the @code{#emacs} and the @code{#rcirc} | |
130 | channels, for example. (Typically, channel names begin with a hash | |
131 | character.) | |
132 | ||
133 | Once you have joined a channel, anything you type will be broadcast to | |
134 | all the other users on the same channel. | |
135 | ||
136 | @cindex addressing other people | |
137 | @cindex other people, addressing them | |
138 | @cindex talk to other people | |
fe5a02b3 AS |
139 | If you want to address someone specifically, for example as an answer to |
140 | a question, it is customary to prefix the message with the nick followed | |
141 | by a colon, like this: | |
97ed0ac3 EZ |
142 | |
143 | @example | |
144 | deego: fsbot rules! | |
145 | @end example | |
146 | ||
147 | @cindex nick completion | |
148 | @cindex completion of nicks | |
149 | @kindex TAB | |
150 | Since this is so common, you can use @key{TAB} to do nick completion. | |
151 | ||
152 | @node Getting started with rcirc, , Internet Relay Chat, Basics | |
153 | @section Getting started with rcirc | |
154 | @cindex getting started | |
155 | @cindex connecting to a server | |
156 | ||
157 | @cindex irc command | |
fe5a02b3 AS |
158 | Use the command @kbd{M-x irc} to connect using the defaults. |
159 | @xref{Configuration}, if you want to change the defaults. | |
160 | ||
161 | Use @kbd{C-u M-x irc} if you don't want to use the defaults, eg. if you | |
162 | want to connect to a different network, or connect to the same network | |
163 | using a different nick. This will prompt you for four things: | |
97ed0ac3 EZ |
164 | |
165 | @table @asis | |
166 | @cindex server, connecting | |
167 | @cindex Freenode network | |
168 | @item IRC server | |
169 | What server do you want to connect to? All the servers in a particular | |
170 | network are equivalent. Some networks use a round-robin system where a | |
171 | single server redirects new connections to a random server in the | |
172 | network. @code{irc.freenode.net} is such a server for the Freenode | |
173 | network. Freenode provides the network ``for the Free and Open Source | |
174 | Software communities, for not-for-profit organisations and for related | |
175 | communities and organizations.'' | |
176 | ||
177 | @cindex port, connecting | |
178 | @cindex 6667, default IRC port | |
179 | @item IRC port | |
180 | All network connections require a port. Just as web servers and clients | |
181 | use port 80 per default, IRC uses port 6667 per default. You rarely | |
182 | have to use a different port. | |
183 | ||
184 | @cindex nick, connecting | |
185 | @cindex changing nick | |
186 | @cindex name changes | |
187 | @item IRC nick | |
188 | @vindex user-login-name | |
189 | Every users needs a handle on-line. You will automatically be assigned | |
190 | a slightly different nick if your chosen nick is already in use. If | |
fe5a02b3 | 191 | your @code{user-login-name} is @code{alex}, and this nick is already |
97ed0ac3 EZ |
192 | in use, you might for example get assigned the nick @code{alex`}. |
193 | ||
194 | @cindex channels, connecting | |
195 | @cindex initial channels | |
196 | @cindex startup channels | |
197 | @item Channels | |
198 | A space separated list of channels you want to join when connecting. | |
199 | You don't need to join any channels, if you just want to have one-to-one | |
200 | conversations with friends on the same network. If you're new to the | |
fe5a02b3 AS |
201 | Freenode network, join @code{#emacs}, the channel about all things |
202 | Emacs, or join @code{#rcirc}, the channel about @code{rcirc}. | |
97ed0ac3 EZ |
203 | @end table |
204 | ||
205 | @cindex server buffer | |
206 | When you have answered these questions, @code{rcirc} will create a server | |
207 | buffer, which will be named something like @code{*irc.freenode.net*}, | |
208 | and a channel buffer for each of the channels you wanted to join. | |
209 | ||
210 | @kindex RET | |
211 | @cindex talking | |
212 | @cindex communicating | |
213 | To talk in a channel, just type in what you want to say in a channel | |
d177d64e | 214 | buffer, and press @key{RET}. |
97ed0ac3 EZ |
215 | |
216 | @kindex C-c C-c | |
217 | @cindex multiline messages | |
218 | @cindex messages, multiple lines | |
219 | @cindex pasting multiple lines | |
220 | @cindex edit message before sending | |
221 | If you want to paste multiple lines, such as source code, you can use | |
222 | @kbd{C-c C-c} to edit your message in a separate buffer. Use @kbd{C-c | |
d177d64e | 223 | C-c} to finish editing. You still need to press @key{RET} to send it, |
97ed0ac3 EZ |
224 | though. Generally, IRC users don't like people pasting more than around |
225 | four lines of code, so use with care. | |
226 | ||
97ed0ac3 EZ |
227 | @node Reference, Hacking and Tweaking, Basics, Top |
228 | @chapter Reference | |
229 | @cindex reference | |
230 | ||
231 | This is the reference section of the manual. It is not complete. For | |
232 | complete listings of @code{rcirc} features, use Emacs built-in | |
233 | documentation. | |
234 | ||
235 | @menu | |
62e77f3d LT |
236 | * rcirc commands:: |
237 | * Useful IRC commands:: | |
238 | * Configuration:: | |
97ed0ac3 EZ |
239 | @end menu |
240 | ||
241 | @node rcirc commands, Useful IRC commands, Reference, Reference | |
242 | @section rcirc commands | |
d177d64e | 243 | @cindex rcirc commands |
97ed0ac3 EZ |
244 | @cindex commands |
245 | ||
246 | @kindex C-h m | |
247 | This is a list of commands that you may use in @code{rcirc}. It is not | |
248 | complete. For a complete listing, press @kbd{C-h m} in an @code{rcirc} | |
249 | buffer. | |
250 | ||
251 | In addition to using regular Emacs key bindings, you can call them by | |
252 | typing them into an @code{rcirc} buffer. | |
253 | ||
254 | @cindex call commands | |
255 | @cindex typing commands | |
256 | @cindex commands | |
257 | For instance, instead of using the command @kbd{C-c C-j} to join a new | |
d177d64e | 258 | channel, you may type this in an @code{rcirc} buffer, and press @key{RET}: |
97ed0ac3 EZ |
259 | |
260 | @example | |
261 | /join #emacs | |
262 | @end example | |
263 | ||
264 | @cindex / starts a command | |
265 | @cindex messages starting with a slash disappear | |
266 | @cindex disappearing messages if starting with a slash | |
267 | @cindex slash hides message | |
268 | This is why you cannot start a message with a slash. You will have to | |
269 | precede the command with a space, or rewrite your message in order to | |
270 | send it to a channel. | |
271 | ||
272 | @cindex multiple words as parameters | |
273 | @cindex string delimiters | |
274 | @cindex quotes | |
275 | @cindex double-quotes | |
276 | Many commands take parameters. IRC commands usually ignore string | |
277 | delimiters. Neither quote nor double-quote have special meanings in | |
278 | IRC. | |
279 | ||
280 | @example | |
281 | /nick "alex schroeder" | |
282 | @end example | |
283 | ||
284 | This will try to change your nick to @code{"alex}. Usually this will | |
285 | fail because the double quote character is not a legal character for | |
286 | nicks. | |
287 | ||
288 | @cindex case insensitive commands | |
289 | These commands are case insensitive. | |
290 | ||
291 | @cindex new command | |
292 | @cindex unknown command | |
293 | @cindex command unknown | |
294 | If a command isn't known by @code{rcirc}, it will simply be sent along to the | |
295 | server. There is a list of some useful commands like that in the next | |
296 | section. | |
297 | ||
298 | @table @kbd | |
299 | @item C-c C-j | |
300 | @kindex C-c C-j | |
301 | @cindex /join | |
302 | @cindex join channels | |
303 | @cindex other channels | |
304 | @cindex rooms, joining | |
305 | @cindex discussion, joining | |
306 | This joins a channel such as @code{#rcirc} or @code{#emacs}. On most | |
307 | networks, anybody can create new channels. If you want to talk with | |
308 | some friends, for example, all you have to do is agree on a valid | |
309 | channel name and join that channel. (Also @code{/join #emacs}.) | |
310 | ||
311 | @item C-c C-p | |
312 | @kindex C-c C-p | |
313 | @cindex /part | |
314 | @cindex part a channel | |
315 | @cindex leave a channel | |
316 | @cindex disconnect from a channel | |
317 | @cindex stop talking on a channel | |
318 | @cindex kill channel buffer | |
319 | This leaves the current channel. You can optionally provide a reason | |
320 | for parting. When you kill a channel buffer, you automatically part the | |
321 | corresponding channel. (Also @code{/part you are too weird!}.) | |
322 | ||
323 | @item C-c C-r | |
324 | @kindex C-c C-r | |
325 | @cindex /nick | |
326 | @cindex change name | |
327 | @cindex nick changing | |
328 | @cindex rename yourself | |
329 | @cindex other name | |
330 | This changes your nick to some other name. Your nick must be unique | |
331 | across the network. Most networks don't allow too many nick changes in | |
332 | quick succession, and have restrictions on the valid characters in nick | |
333 | names. (Also @code{/nick alex-test}) | |
334 | ||
335 | @item C-c C-w | |
336 | @kindex C-c C-w | |
337 | @cindex /whois | |
338 | @cindex who are these people | |
339 | @cindex identifying people | |
340 | @cindex channels other people are on | |
341 | @cindex what channels people are on | |
342 | Gives you some basic information about a nick. This often includes what | |
343 | other channels people are on. (Also @code{/whois fsbot}.) | |
344 | ||
345 | @item C-c C-q | |
346 | @kindex C-c C-q | |
347 | @cindex /query | |
348 | @cindex starting a private conversation | |
349 | @cindex one-to-one conversation | |
350 | @cindex talk privately | |
351 | @cindex private conversation | |
352 | @cindex contact one person only | |
353 | @cindex query a person | |
354 | Starts a one-to-one conversation with another person on the same | |
355 | network. A new buffer will be created for this conversation. It works | |
356 | like a channel with only two members. (Also @code{/query fsbot}.) | |
357 | ||
d177d64e | 358 | @item C-c @key{RET} |
97ed0ac3 EZ |
359 | @kindex C-c RET |
360 | @cindex /msg | |
361 | @cindex single message | |
362 | @cindex message sending | |
363 | This sends a single message to a nick. Like with @kbd{C-c C-q}, a new | |
364 | buffer is created, where the response from the other party will show | |
365 | up. (Also @code{/msg nickserv identify secret}.) | |
366 | ||
367 | @item C-c C-x | |
368 | @kindex C-c C-x | |
369 | @cindex /quit | |
370 | @cindex quit | |
371 | @cindex disconnect | |
372 | @cindex kill connection | |
373 | @cindex connection end | |
374 | @cindex part all channels | |
375 | @cindex end connection | |
376 | @cindex server buffer killing | |
377 | @cindex reason for quitting | |
378 | This disconnects from the server and parts all channels. You can | |
379 | optionally provide a reason for quitting. When you kill the server | |
380 | buffer, you automatically quit the server and part all channels. (Also | |
381 | @code{/quit ZZZzzz...}.) | |
382 | @end table | |
383 | ||
384 | Some commands may not have a key binding, but only be available as typed | |
385 | commands, such as: | |
386 | ||
387 | @table @code | |
388 | @item /ignore | |
389 | @cindex /ignore | |
390 | @cindex ignoring other people | |
391 | @cindex trolls, ignoring | |
392 | @cindex hide some posts | |
393 | @cindex idiots online | |
394 | This command toggles the ignore status of a nick, if you provide one. | |
395 | If you don't provide a nick, the command lists all the nicks you are | |
d177d64e AS |
396 | ignoring. All messages by ignored nicks are---you guessed it---ignored. |
397 | Since only ``operators'' can kick people from channels, the | |
97ed0ac3 EZ |
398 | ignore command is often the only way to deal with some of the more |
399 | obnoxious fellows online. Example: @code{/ignore xah}. | |
400 | @end table | |
401 | ||
402 | @node Useful IRC commands, Configuration, rcirc commands, Reference | |
403 | @section Useful IRC commands | |
404 | @cindex irc commands | |
405 | @cindex commands | |
406 | ||
407 | As mentioned, if a command isn't known by @code{rcirc}, it will simply be sent | |
408 | along to the server. Some such commands are available on nearly all IRC | |
409 | servers, such as: | |
410 | ||
411 | @table @code | |
412 | @item /away | |
413 | @cindex /away | |
414 | @cindex away status | |
415 | @cindex pause status | |
416 | @cindex unavailable status | |
417 | @cindex set away status | |
418 | This sets your status as ``being away'' if you provide a reason, or sets | |
419 | your status as ``being back'' if you do not. People can use the | |
420 | @kbd{C-c C-w} command to check your status. Example: @code{/away food}. | |
421 | @end table | |
422 | ||
423 | @cindex irc resources | |
424 | @cindex help about irc | |
425 | Typical IRC servers implement many more commands. You can read more | |
426 | about the fantastic world of IRC online at | |
b4a349d1 EZ |
427 | @uref{http://www.irchelp.org/, the Internet Relay Chat (IRC) help |
428 | archive}. | |
97ed0ac3 EZ |
429 | |
430 | @node Configuration, , Useful IRC commands, Reference | |
431 | @section Configuration | |
d177d64e | 432 | @cindex configuring rcirc |
97ed0ac3 EZ |
433 | |
434 | These are some variables you can change to configure @code{rcirc} to your | |
435 | liking. | |
436 | ||
437 | @table @code | |
fe5a02b3 AS |
438 | @item rcirc-default-server |
439 | @vindex rcirc-default-server | |
97ed0ac3 EZ |
440 | the default server to connect to. |
441 | ||
fe5a02b3 AS |
442 | @item rcirc-default-port |
443 | @vindex rcirc-default-port | |
97ed0ac3 EZ |
444 | the default port to connect to. |
445 | ||
fe5a02b3 AS |
446 | @item rcirc-default-nick |
447 | @vindex rcirc-default-nick | |
97ed0ac3 EZ |
448 | the default nick to use. |
449 | @end table | |
450 | ||
451 | @example | |
fe5a02b3 AS |
452 | (setq rcirc-default-server "irc.mozilla.org" |
453 | rcirc-default-port 6666 | |
454 | rcirc-default-nick "alx") | |
97ed0ac3 EZ |
455 | @end example |
456 | ||
fe5a02b3 | 457 | @vindex rcirc-default-user-full-name |
97ed0ac3 EZ |
458 | @cindex full name |
459 | @cindex real name | |
460 | @cindex surname | |
fe5a02b3 AS |
461 | @code{rcirc-default-user-full-name} is used to set your ``real name'' on |
462 | IRC. It defaults to @code{user-full-name}. If you want to hide your | |
463 | full name, you might want to set it to some pseudonym. | |
97ed0ac3 EZ |
464 | |
465 | @example | |
fe5a02b3 | 466 | (setq rcirc-default-user-full-name "Curious Minds Want To Know") |
97ed0ac3 EZ |
467 | @end example |
468 | ||
469 | @vindex rcirc-startup-channels-alist | |
470 | @cindex channels, configuration | |
471 | @cindex initial channels, configuration | |
472 | @cindex startup channels, configuration | |
473 | @code{rcirc-startup-channels-alist} is the alist of channels to join | |
474 | when connecting to a particular network. An alist is a list of lists. | |
475 | Each sublist starts with a regular expression that is compared to the | |
476 | server address you're connecting to. The remaining sublist items are | |
477 | the channels to join. | |
478 | ||
479 | @example | |
480 | (setq rcirc-startup-channels-alist | |
481 | '(("\\.freenode\\.net$" "#emacs" "#rcirc" "#wiki"))) | |
482 | @end example | |
483 | ||
484 | Note the subtle problem, here --- IRC clients connect to servers, and | |
485 | there is no way of knowing which servers belong to a particular network. | |
486 | In the example above we're exploiting a naming convention used by within | |
487 | the Freenode network --- all servers within the network have a host in | |
488 | the @code{freenode.net} domain. | |
489 | ||
fe5a02b3 AS |
490 | @vindex rcirc-authinfo |
491 | @cindex authentification | |
492 | @cindex identification | |
493 | @cindex nickserv | |
494 | @cindex login | |
495 | @code{rcirc-authinfo} is an alist used to automatically identify | |
496 | yourself on networks. Each sublist starts with a regular expression | |
497 | that is compared to the server address you're connecting to. The second | |
498 | element in the list is a symbol representing the method to use, followed | |
499 | by the arguments this method requires. | |
500 | ||
501 | Here is an example to illustrate how you would set it: | |
502 | ||
503 | @example | |
e96b0051 | 504 | (setq rcirc-authinfo |
fe5a02b3 AS |
505 | '(("freenode" nickserv "bob" "p455w0rd") |
506 | ("freenode" chanserv "bob" "#bobland" "passwd99") | |
507 | ("bitlbee" bitlbee "robert" "sekrit"))) | |
508 | @end example | |
509 | ||
510 | And here are the valid method symbols and the arguments they require: | |
511 | ||
512 | @table @code | |
513 | @item nickserv | |
514 | @cindex nickserv authentification | |
515 | Use this symbol if you need to identify yourself as follows when | |
516 | connecting to a network: @code{/msg nickserv identify secret}. The | |
517 | necessary arguments are the nickname you want to use this for, and the | |
518 | password to use. | |
519 | ||
520 | Before you can use this method, you will have to register your nick and | |
521 | pick a password for it. Contact @code{nickserv} and check out the | |
522 | details. (Using @code{/msg nickserv help}, for example.) | |
523 | ||
524 | @item chanserv | |
525 | @cindex chanserv authentification | |
526 | Use this symbol if you need to identify yourself as follows if you want | |
527 | to join a particular channel: @code{/msg chanserv identify #underground | |
528 | secret}. The necessary arguments are the nickname and channel you want | |
529 | to use this for, and the password to use. | |
530 | ||
531 | Before you can use this method, a channel contact must tell you about | |
532 | the password to use. Contact @code{chanserv} and check out the details. | |
533 | (Using @code{/msg chanserv help}, for example.) | |
534 | ||
535 | @item bitlbee | |
536 | @cindex bitlbee authentification | |
537 | Use this symbol if you need to identify yourself in the Bitlbee channel | |
538 | as follows: @code{identify secret}. The necessary arguments are the | |
539 | nickname you want to use this for, and the password to use. | |
540 | ||
541 | @cindex gateway to other IM services | |
542 | @cindex instant messaging, other services | |
543 | @cindex Jabber | |
544 | @cindex AIM | |
545 | @cindex ICQ | |
546 | @cindex MSN | |
547 | @cindex Yahoo! | |
548 | Bitlbee acts like an IRC server, but in fact it is a gateway to a lot of | |
549 | other instant messaging services. You can either install Bitlbee | |
550 | locally or use a public Bitlbee server. There, you need to create an | |
551 | account with a password. This is the nick and password you need to | |
552 | provide for the bitlbee authentification method. | |
553 | ||
554 | Later, you will tell Bitlbee about your accounts and passwords on all | |
555 | the other instant messaging services, and Bitlbee will log you in. All | |
556 | @code{rcirc} needs to know, is the login to your Bitlbee account. Don't | |
557 | confuse the Bitlbee account with all the other accounts. | |
558 | @end table | |
559 | ||
560 | @kindex C-c C-SPC | |
561 | @vindex rcirc-track-minor-mode | |
562 | @cindex switching channels | |
563 | @cindex tracking activity | |
564 | @cindex active channel | |
565 | @cindex abbreviated channel names | |
566 | @cindex modeline tracks activity | |
567 | Most people want a notification when something is said on a channel they | |
568 | have joined, particularly if they have been addressed directly. There | |
569 | is a global minor mode that will do this kind of tracking for you. All | |
570 | you need to do is switch it on using @kbd{M-x rcirc-track-minor-mode}. | |
571 | To make this permanent, add the following to your init file: | |
572 | ||
573 | @example | |
574 | (rcirc-track-minor-mode 1) | |
575 | @end example | |
576 | ||
577 | When other people say things in buffers that are currently buried (no | |
578 | window is showing them), the mode line will now show you the abbreviated | |
579 | channel or nick name. Use @kbd{C-c C-@key{SPC}} to switch to these | |
580 | buffers. | |
581 | ||
582 | @vindex rcirc-mode-hook | |
583 | If you prefer not to load @code{rcirc} immediately, you can delay the | |
584 | activation of this mode: | |
585 | ||
586 | @example | |
587 | (add-hook 'rcirc-mode-hook | |
588 | (lambda () | |
589 | (rcirc-track-minor-mode 1))) | |
590 | @end example | |
591 | ||
97ed0ac3 EZ |
592 | @node Hacking and Tweaking, Key Index, Reference, Top |
593 | @chapter Hacking and Tweaking | |
594 | @cindex hacking and tweaking | |
595 | ||
596 | Here are some examples of stuff you can do to configure @code{rcirc}. | |
597 | ||
598 | @menu | |
62e77f3d LT |
599 | * Skipping /away messages using handlers:: |
600 | * Using fly spell mode:: | |
601 | * Scrolling conservatively:: | |
602 | * Changing the time stamp format:: | |
603 | * Defining a new command:: | |
604 | * Reconnecting after you have lost the connection:: | |
97ed0ac3 EZ |
605 | @end menu |
606 | ||
607 | @node Skipping /away messages using handlers, Using fly spell mode, Hacking and Tweaking, Hacking and Tweaking | |
608 | @section Skipping @code{/away} messages using handlers | |
609 | @cindex /away messages | |
610 | ||
611 | @cindex handlers | |
612 | @cindex status codes | |
62e77f3d | 613 | The IRC protocol specifies how certain events are signaled from server |
97ed0ac3 EZ |
614 | to client. These events have numbers and are dealt with using so-called |
615 | handlers. You can override existing handlers by exploiting the naming | |
616 | convention adopted for @code{rcirc}. | |
617 | ||
618 | Here's how to stop @code{rcirc} from printing @code{/away} messages. | |
619 | Since @code{rcirc} doesn't define a 301 handler, you don't need to | |
620 | require @code{rcirc} before defining the handler: | |
621 | ||
622 | @example | |
623 | (defun rcirc-handler-301 (process cmd sender args) | |
624 | "/away message handler.") | |
625 | @end example | |
626 | ||
627 | @node Using fly spell mode, Scrolling conservatively, Skipping /away messages using handlers, Hacking and Tweaking | |
628 | @section Using fly spell mode | |
629 | @cindex fly spell | |
630 | @cindex spelling | |
631 | @cindex spell-checking as you type | |
632 | @cindex automatic spelling | |
633 | @vindex rcirc-mode-hook | |
634 | ||
635 | The following code activates Fly Spell Mode | |
636 | for @code{rcirc} buffers: | |
637 | ||
638 | @example | |
639 | (add-hook 'rcirc-mode-hook (lambda () | |
640 | (flyspell-mode 1))) | |
641 | @end example | |
642 | ||
643 | @xref{Spelling, , Flyspell mode, emacs, The GNU Emacs Manual}, | |
644 | for details. | |
645 | ||
646 | @node Scrolling conservatively, Changing the time stamp format, Using fly spell mode, Hacking and Tweaking | |
647 | @section Scrolling conservatively | |
648 | @cindex input line | |
649 | @cindex scrolling | |
650 | @vindex scroll-conservatively | |
651 | @vindex rcirc-mode-hook | |
652 | ||
653 | IRC buffers are constantly growing. If you want to see as much as | |
654 | possible at all times, you would want the prompt at the bottom of the | |
655 | window when possible. The following snippet uses a local value for | |
656 | @code{scroll-conservatively} to achieve this: | |
657 | ||
658 | @example | |
659 | (add-hook 'rcirc-mode-hook | |
660 | (lambda () | |
661 | (set (make-local-variable 'scroll-conservatively) | |
662 | 8192))) | |
663 | @end example | |
664 | ||
fe5a02b3 | 665 | @xref{Scrolling, , Scrolling conservatively, emacs, The GNU Emacs |
97ed0ac3 EZ |
666 | Manual}, for details. |
667 | ||
668 | @node Changing the time stamp format, Defining a new command, Scrolling conservatively, Hacking and Tweaking | |
669 | @section Changing the time stamp format | |
670 | @cindex time stamp | |
671 | @cindex date time | |
672 | @cindex format time stamp | |
673 | @vindex rcirc-time-format | |
674 | ||
675 | @code{rcirc-time-format} is the format used for the time stamp. Here's | |
676 | how to include the date in the time stamp: | |
677 | ||
678 | @example | |
679 | (setq rcirc-time-format "%Y-%m-%d %H:%M ") | |
680 | @end example | |
681 | ||
682 | @node Defining a new command, Reconnecting after you have lost the connection, Changing the time stamp format, Hacking and Tweaking | |
683 | @section Defining a new command | |
684 | @cindex defining commands | |
685 | @cindex commands, defining | |
686 | @cindex new commands, defining | |
687 | ||
688 | Here's a simple new command, @code{/sv}. With it, you can boast about | |
689 | your IRC client. It shows how you can use @code{defun-rcirc-command} to | |
690 | define new commands. | |
691 | ||
692 | We're waiting for the definition of this command until @code{rcirc} is loaded | |
693 | because @code{defun-rcirc-command} is not yet available, and without | |
694 | @code{rcirc} loaded, the command wouldn't do us much good anyway. | |
695 | ||
696 | @smallexample | |
697 | (eval-after-load 'rcirc | |
698 | '(defun-rcirc-command sv (arg) | |
699 | "Boast about rcirc." | |
700 | (interactive "i") | |
701 | (rcirc-send-message process target | |
702 | (concat "I use " rcirc-id-string)))) | |
703 | @end smallexample | |
704 | ||
705 | @node Reconnecting after you have lost the connection, , Defining a new command, Hacking and Tweaking | |
706 | @section Reconnecting after you have lost the connection | |
707 | @cindex reconnecting | |
708 | @cindex disconnecting servers, reconnecting | |
709 | ||
710 | If you're chatting from a laptop, then you might be familiar with this | |
711 | problem: When your laptop falls asleep and wakes up later, your IRC | |
712 | client doesn't realise that it has been disconnected. It takes several | |
713 | minutes until the client decides that the connection has in fact been | |
714 | lost. The simple solution is to use @kbd{M-x rcirc}. The problem is | |
715 | that this opens an @emph{additional} connection, so you'll have two | |
716 | copies of every channel buffer --- one dead and one live. | |
717 | ||
718 | The real answer, therefore, is a @code{/reconnect} command: | |
719 | ||
720 | @smallexample | |
721 | (eval-after-load 'rcirc | |
722 | '(defun-rcirc-command reconnect (arg) | |
723 | "Reconnect the server process." | |
724 | (interactive "i") | |
725 | (unless process | |
726 | (error "There's no process for this target")) | |
727 | (let* ((server (car (process-contact process))) | |
728 | (port (process-contact process :service)) | |
fe5a02b3 | 729 | (nick (rcirc-nick process)) |
97ed0ac3 EZ |
730 | channels query-buffers) |
731 | (dolist (buf (buffer-list)) | |
732 | (with-current-buffer buf | |
fe5a02b3 AS |
733 | (when (eq process (rcirc-buffer-process)) |
734 | (remove-hook 'change-major-mode-hook | |
735 | 'rcirc-change-major-mode-hook) | |
97ed0ac3 EZ |
736 | (if (rcirc-channel-p rcirc-target) |
737 | (setq channels (cons rcirc-target channels)) | |
738 | (setq query-buffers (cons buf query-buffers)))))) | |
739 | (delete-process process) | |
fe5a02b3 AS |
740 | (rcirc-connect server port nick |
741 | rcirc-default-user-name | |
742 | rcirc-default-user-full-name | |
743 | channels)))) | |
97ed0ac3 EZ |
744 | @end smallexample |
745 | ||
746 | @node Key Index, Variable Index, Hacking and Tweaking, Top | |
747 | @unnumbered Key Index | |
748 | @printindex ky | |
749 | ||
750 | @node Variable Index, Index, Key Index, Top | |
751 | @unnumbered Variable Index | |
752 | @printindex vr | |
753 | ||
754 | @node Index, , Variable Index, Top | |
755 | @unnumbered Index | |
756 | @printindex cp | |
757 | ||
758 | @bye | |
cd7070ad MB |
759 | |
760 | @ignore | |
761 | arch-tag: 2589e562-3843-4ffc-8c2f-477cbad57c01 | |
762 | @end ignore |