Remove more hand-written node pointers in doc/misc
[bpt/emacs.git] / doc / misc / rcirc.texi
1 \input texinfo
2 @c %**start of header
3 @setfilename ../../info/rcirc
4 @settitle rcirc Manual
5 @c %**end of header
6
7 @copying
8 Copyright @copyright{} 2006--2012 Free Software Foundation, Inc.
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.3 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''.
17
18 (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
19 modify this GNU manual.''
20 @end quotation
21 @end copying
22
23 @dircategory Emacs network features
24 @direntry
25 * Rcirc: (rcirc). Internet Relay Chat (IRC) client.
26 @end direntry
27
28 @titlepage
29 @title rcirc Manual
30 @page
31 @vskip 0pt plus 1filll
32 @insertcopying
33 @end titlepage
34
35 @contents
36
37 @ifnottex
38 @node Top
39 @top rcirc Manual
40
41 @code{rcirc} is an Emacs IRC client.
42
43 IRC (Internet Relay Chat) is a multi-user chat protocol. Users
44 communicate with each other in real-time. Communication occurs both in
45 topic channels which are collections of many users, or privately, with
46 just one other user.
47
48 @insertcopying
49
50 @end ifnottex
51
52 @menu
53 * Basics::
54 * Reference::
55 * Fighting Information Overload::
56 * Hacking and Tweaking::
57 * GNU Free Documentation License::
58 * Key Index::
59 * Variable Index::
60 * Index::
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 Fighting Information Overload
77
78 * Channels::
79 * People::
80 * Keywords::
81 * Notices::
82
83 Hacking and Tweaking
84
85 * Skipping /away messages using handlers::
86 * Using fly spell mode::
87 * Scrolling conservatively::
88 * Changing the time stamp format::
89 * Defining a new command::
90 * Reconnecting after you have lost the connection::
91
92 @end detailmenu
93 @end menu
94
95 @node Basics
96 @chapter Basics
97
98 This chapter contains a brief introduction to IRC (Internet Relay Chat),
99 and a quick tutorial on @code{rcirc}.
100
101 @menu
102 * Internet Relay Chat::
103 * Getting started with rcirc::
104 @end menu
105
106 @node Internet Relay Chat
107 @section Internet Relay Chat
108 @cindex internet relay chat
109 @cindex irc
110
111 @cindex channel
112 @dfn{Internet Relay Chat} (IRC) is a form of instant communication over the
113 Internet. It is mainly designed for group (many-to-many) communication
114 in discussion forums called channels, but also allows one-to-one
115 communication.
116
117 @cindex instant messaging, comparison
118 @cindex server
119 @cindex network
120 Contrary to most Instant Messenger (IM) systems, users usually don't
121 connect to a central server. Instead, users connect to a random
122 server in a network, and servers relay messages from one to the next.
123
124 Here's a typical example:
125
126 @cindex redirection to random servers
127 When you connect to the Freenode network
128 (@code{http://freenode.net/}), you point your IRC client at the
129 server @code{irc.freenode.net}. That server will redirect your client
130 to a random server on the network, such as @code{zelazny.freenode.net}.
131
132 @cindex channel name
133 @cindex # starts a channel name
134 Once you're connected, you can send messages to all other users
135 connected to the same network, and you can join all channels on the same
136 network. You might join the @code{#emacs} and the @code{#rcirc}
137 channels, for example. (Typically, channel names begin with a hash
138 character.)
139
140 Once you have joined a channel, anything you type will be broadcast to
141 all the other users on the same channel.
142
143 @cindex addressing other people
144 @cindex other people, addressing them
145 @cindex talk to other people
146 If you want to address someone specifically, for example as an answer to
147 a question, it is customary to prefix the message with the nick followed
148 by a colon, like this:
149
150 @example
151 deego: fsbot rules!
152 @end example
153
154 @cindex nick completion
155 @cindex completion of nicks
156 @kindex TAB
157 Since this is so common, you can use @key{TAB} to do nick completion.
158
159 @node Getting started with rcirc
160 @section Getting started with rcirc
161 @cindex getting started
162 @cindex connecting to a server
163
164 @cindex irc command
165 Use the command @kbd{M-x irc} to connect using the defaults.
166 @xref{Configuration}, if you want to change the defaults.
167
168 Use @kbd{C-u M-x irc} if you don't want to use the defaults, e.g., if you
169 want to connect to a different network, or connect to the same network
170 using a different nick. This will prompt you for four things:
171
172 @table @asis
173 @cindex server, connecting
174 @cindex Freenode network
175 @item IRC Server
176 What server do you want to connect to? All the servers in a particular
177 network are equivalent. Some networks use a round-robin system where a
178 single server redirects new connections to a random server in the
179 network. @code{irc.freenode.net} is such a server for the Freenode
180 network. Freenode provides the network ``for the Free and Open Source
181 Software communities, for not-for-profit organizations and for related
182 communities and organizations.''
183
184 @cindex port, connecting
185 @cindex 6667, default IRC port
186 @item IRC Port
187 All network connections require a port. Just as web servers and clients
188 use port 80 per default, IRC uses port 6667 per default. You rarely
189 have to use a different port.
190
191 @cindex nick, connecting
192 @cindex changing nick
193 @cindex name changes
194 @item IRC Nick
195 @vindex user-login-name
196 Every users needs a handle on-line. You will automatically be assigned
197 a slightly different nick if your chosen nick is already in use. If
198 your @code{user-login-name} is @code{alex}, and this nick is already
199 in use, you might for example get assigned the nick @code{alex`}.
200
201 @cindex channels, connecting
202 @cindex initial channels
203 @cindex startup channels
204 @item IRC Channels
205 A space separated list of channels you want to join when connecting.
206 You don't need to join any channels, if you just want to have one-to-one
207 conversations with friends on the same network. If you're new to the
208 Freenode network, join @code{#emacs}, the channel about all things
209 Emacs, or join @code{#rcirc}, the channel about @code{rcirc}.
210 @end table
211
212 @cindex server buffer
213 When you have answered these questions, @code{rcirc} will create a server
214 buffer, which will be named something like @code{*irc.freenode.net*},
215 and a channel buffer for each of the channels you wanted to join.
216
217 @kindex RET
218 @cindex talking
219 @cindex communicating
220 To talk in a channel, just type what you want to say in a channel
221 buffer, and press @key{RET}.
222
223 @kindex C-c C-c
224 @cindex multiline messages
225 @cindex messages, multiple lines
226 @cindex pasting multiple lines
227 @cindex edit message before sending
228 If you want to paste multiple lines, such as source code, you can use
229 @kbd{C-c C-c} to edit your message in a separate buffer. Use @kbd{C-c
230 C-c} to finish editing. You still need to press @key{RET} to send it,
231 though. Generally, IRC users don't like people pasting more than around
232 four lines of code, so use with care.
233
234 @comment This section copied from the Channels section.
235 @comment All index markers should point to the original!
236 Once you are connected to multiple channels, or once you've turned you
237 attention to other buffers in Emacs, you probably want to be notified
238 of any activity in channels not currently visible. All you need to do
239 is switch channel tracking on using @kbd{M-x rcirc-track-minor-mode}.
240 To make this permanent, add the following to your init file:
241
242 @example
243 (rcirc-track-minor-mode 1)
244 @end example
245
246 Use @kbd{C-c C-@key{SPC}} to switch to these buffers.
247
248 @node Reference
249 @chapter Reference
250 @cindex reference
251
252 This is the reference section of the manual. It is not complete. For
253 complete listings of @code{rcirc} features, use Emacs built-in
254 documentation.
255
256 @menu
257 * rcirc commands::
258 * Useful IRC commands::
259 * Configuration::
260 @end menu
261
262 @node rcirc commands
263 @section rcirc commands
264 @cindex rcirc commands
265 @cindex commands
266
267 @kindex C-h m
268 This is a list of commands that you may use in @code{rcirc}. It is not
269 complete. For a complete listing, press @kbd{C-h m} in an @code{rcirc}
270 buffer.
271
272 In addition to using regular Emacs key bindings, you can call them by
273 typing them into an @code{rcirc} buffer.
274
275 @cindex call commands
276 @cindex typing commands
277 @cindex commands
278 For instance, instead of using the command @kbd{C-c C-j} to join a new
279 channel, you may type this in an @code{rcirc} buffer, and press @key{RET}:
280
281 @example
282 /join #emacs
283 @end example
284
285 @cindex / starts a command
286 @cindex messages starting with a slash disappear
287 @cindex disappearing messages if starting with a slash
288 @cindex slash hides message
289 This is why you cannot start a message with a slash. You will have to
290 precede the command with a space, or rewrite your message in order to
291 send it to a channel.
292
293 @cindex multiple words as parameters
294 @cindex string delimiters
295 @cindex quotes
296 @cindex double-quotes
297 Many commands take parameters. IRC commands usually ignore string
298 delimiters. Neither quote nor double-quote have special meanings in
299 IRC.
300
301 @example
302 /nick "alex schroeder"
303 @end example
304
305 This will try to change your nick to @code{"alex}. Usually this will
306 fail because the double quote character is not a valid character for
307 nicks.
308
309 @cindex case insensitive commands
310 These commands are case insensitive.
311
312 @cindex new command
313 @cindex unknown command
314 @cindex command unknown
315 If a command isn't known by @code{rcirc}, it will simply be sent along to the
316 server. There is a list of some useful commands like that in the next
317 section.
318
319 @table @kbd
320 @item C-c C-j
321 @kindex C-c C-j
322 @cindex /join
323 @cindex join channels
324 @cindex other channels
325 @cindex rooms, joining
326 @cindex discussion, joining
327 This joins a channel such as @code{#rcirc} or @code{#emacs}. On most
328 networks, anybody can create new channels. If you want to talk with
329 some friends, for example, all you have to do is agree on a valid
330 channel name and join that channel. (Also @code{/join #emacs}.)
331
332 @item C-c C-p
333 @kindex C-c C-p
334 @cindex /part
335 @cindex part a channel
336 @cindex leave a channel
337 @cindex disconnect from a channel
338 @cindex stop talking on a channel
339 @cindex kill channel buffer
340 This leaves the current channel. You can optionally provide a reason
341 for parting. When you kill a channel buffer, you automatically part the
342 corresponding channel. (Also @code{/part you are too weird!}.)
343
344 @item C-c C-r
345 @kindex C-c C-r
346 @cindex /nick
347 @cindex change name
348 @cindex nick changing
349 @cindex rename yourself
350 @cindex other name
351 This changes your nick to some other name. Your nick must be unique
352 across the network. Most networks don't allow too many nick changes in
353 quick succession, and have restrictions on the valid characters in nick
354 names. (Also @code{/nick alex-test})
355
356 @item C-c C-w
357 @kindex C-c C-w
358 @cindex /whois
359 @cindex who are these people
360 @cindex identifying people
361 @cindex channels other people are on
362 @cindex what channels people are on
363 Gives you some basic information about a nick. This often includes what
364 other channels people are on. (Also @code{/whois fsbot}.)
365
366 @item C-c C-q
367 @kindex C-c C-q
368 @cindex /query
369 @cindex starting a private conversation
370 @cindex one-to-one conversation
371 @cindex talk privately
372 @cindex private conversation
373 @cindex contact one person only
374 @cindex query a person
375 Starts a one-to-one conversation with another person on the same
376 network. A new buffer will be created for this conversation. It works
377 like a channel with only two members. (Also @code{/query fsbot}.)
378
379 @item C-c @key{RET}
380 @kindex C-c RET
381 @cindex /msg
382 @cindex single message
383 @cindex message sending
384 This sends a single message to a nick. Like with @kbd{C-c C-q}, a new
385 buffer is created, where the response from the other party will show
386 up. (Also @code{/msg nickserv identify secret}.)
387
388 @item C-c C-x
389 @kindex C-c C-x
390 @cindex /quit
391 @cindex quit
392 @cindex disconnect
393 @cindex kill connection
394 @cindex connection end
395 @cindex part all channels
396 @cindex end connection
397 @cindex server buffer killing
398 @cindex reason for quitting
399 This disconnects from the server and parts all channels. You can
400 optionally provide a reason for quitting. When you kill the server
401 buffer, you automatically quit the server and part all channels. (Also
402 @code{/quit ZZZzzz...}.)
403 @end table
404
405 @node Useful IRC commands
406 @section Useful IRC commands
407 @cindex irc commands
408 @cindex commands
409
410 As mentioned, if a command isn't known by @code{rcirc}, it will simply be sent
411 along to the server. Some such commands are available on nearly all IRC
412 servers, such as:
413
414 @table @code
415 @item /away
416 @cindex /away
417 @cindex away status
418 @cindex pause status
419 @cindex unavailable status
420 @cindex set away status
421 This sets your status as ``being away'' if you provide a reason, or sets
422 your status as ``being back'' if you do not. People can use the
423 @kbd{C-c C-w} command to check your status. Example: @code{/away food}.
424 @end table
425
426 @cindex irc resources
427 @cindex help about irc
428 Typical IRC servers implement many more commands. You can read more
429 about the fantastic world of IRC online at
430 @uref{http://www.irchelp.org/, the Internet Relay Chat (IRC) help
431 archive}.
432
433 @node Configuration
434 @section Configuration
435 @cindex configuring rcirc
436
437 These are some variables you can change to configure @code{rcirc} to your
438 liking.
439
440 @table @code
441 @item rcirc-server-alist
442 @vindex rcirc-server-alist
443 @cindex channels, configuration
444 @cindex initial channels, configuration
445 @cindex startup channels, configuration
446 @cindex servers, configuration
447 @cindex initial servers, configuration
448 @cindex startup servers, configuration
449 This variable contains an alist of servers to connect to by default
450 and the keywords parameters to use. The keyword parameters are
451 optional. If you don't provide any, the defaults as documented below
452 will be used.
453
454 The most important parameter is the @code{:channels} parameter. It
455 controls which channels you will join by default as soon as you are
456 connected to the server.
457
458 Here's an example of how to set it:
459
460 @example
461 (add-to-list 'rcirc-server-alist
462 '("otherworlders.org"
463 :channels ("#FUDGE" "#game-design")))
464 @end example
465
466 By default you will be connected to the @code{rcirc} support channel:
467 @code{#rcirc} on @code{irc.freenode.net}.
468
469 @table @code
470 @item :nick
471 This overrides @code{rcirc-default-nick}.
472
473 @item :port
474 This overrides @code{rcirc-default-port}.
475
476 @item :user-name
477 This overrides @code{rcirc-default-user-name}.
478
479 @item :full-name
480 This overrides @code{rcirc-default-full-name}.
481
482 @item :channels
483 This describes which channels to join when connecting to the server.
484 If absent, no channels will be connected to automatically.
485
486 @end table
487
488 @item rcirc-default-nick
489 @vindex rcirc-default-nick
490 This variable is used for the default nick. It defaults to the login
491 name returned by @code{user-login-name}.
492
493 @example
494 (setq rcirc-default-nick "kensanata")
495 @end example
496
497 @item rcirc-default-port
498 @vindex rcirc-default-port
499 @cindex port
500 This variable contains the default port to connect to. It is 6667 by
501 default and rarely needs changing.
502
503 @item rcirc-default-user-name
504 @vindex rcirc-default-user-name
505 @cindex user name
506 This variable contains the default user name to report to the server.
507 It defaults to the login name returned by @code{user-login-name}, just
508 like @code{rcirc-default-nick}.
509
510 @item rcirc-default-full-name
511 @vindex rcirc-default-full-name
512 @cindex full name
513 @cindex real name
514 @cindex surname
515 This variable is used to set your ``real name'' on IRC@. It defaults
516 to the name returned by @code{user-full-name}. If you want to hide
517 your full name, you might want to set it to some pseudonym.
518
519 @example
520 (setq rcirc-default-full-name "Curious Minds Want To Know")
521 @end example
522
523 @item rcirc-authinfo
524 @vindex rcirc-authinfo
525 @cindex authentication
526 @cindex identification
527 @cindex nickserv
528 @cindex login
529 This variable is an alist used to automatically identify yourself on
530 networks. Each sublist starts with a regular expression that is
531 compared to the server address you're connecting to. The second
532 element in the list is a symbol representing the method to use,
533 followed by the arguments this method requires.
534
535 Here is an example to illustrate how you would set it:
536
537 @example
538 (setq rcirc-authinfo
539 '(("freenode" nickserv "bob" "p455w0rd")
540 ("freenode" chanserv "bob" "#bobland" "passwd99")
541 ("bitlbee" bitlbee "robert" "sekrit")))
542 @end example
543
544 And here are the valid method symbols and the arguments they require:
545
546 @table @code
547 @item nickserv
548 @cindex nickserv authentication
549 Use this symbol if you need to identify yourself as follows when
550 connecting to a network: @code{/msg nickserv identify secret}. The
551 necessary arguments are the nickname you want to use this for, and the
552 password to use.
553
554 Before you can use this method, you will have to register your nick and
555 pick a password for it. Contact @code{nickserv} and check out the
556 details. (Using @code{/msg nickserv help}, for example.)
557
558 @item chanserv
559 @cindex chanserv authentication
560 Use this symbol if you need to identify yourself as follows if you want
561 to join a particular channel: @code{/msg chanserv identify #underground
562 secret}. The necessary arguments are the nickname and channel you want
563 to use this for, and the password to use.
564
565 Before you can use this method, a channel contact must tell you about
566 the password to use. Contact @code{chanserv} and check out the details.
567 (Using @code{/msg chanserv help}, for example.)
568
569 @item bitlbee
570 @cindex bitlbee authentication
571 Use this symbol if you need to identify yourself in the Bitlbee channel
572 as follows: @code{identify secret}. The necessary arguments are the
573 nickname you want to use this for, and the password to use.
574
575 @cindex gateway to other IM services
576 @cindex instant messaging, other services
577 @cindex Jabber
578 @cindex AIM
579 @cindex ICQ
580 @cindex MSN
581 @cindex Yahoo!
582 Bitlbee acts like an IRC server, but in fact it is a gateway to a lot of
583 other instant messaging services. You can either install Bitlbee
584 locally or use a public Bitlbee server. There, you need to create an
585 account with a password. This is the nick and password you need to
586 provide for the bitlbee authentication method.
587
588 Later, you will tell Bitlbee about your accounts and passwords on all
589 the other instant messaging services, and Bitlbee will log you in. All
590 @code{rcirc} needs to know, is the login to your Bitlbee account. Don't
591 confuse the Bitlbee account with all the other accounts.
592
593 @end table
594
595 @end table
596
597 @node Fighting Information Overload
598 @chapter Fighting Information Overload
599 @cindex information overload
600
601 This is the section of the manual that caters to the busy person
602 online. There are support channels with several hundred people in
603 them. Trying to follow a conversation in these channels can be a
604 daunting task. This chapters tells you how @code{rcirc} can help.
605
606 @menu
607 * Channels::
608 * People::
609 * Keywords::
610 * Notices::
611 @end menu
612
613 @node Channels
614 @section Channels
615 @cindex channels
616 @cindex modeline
617
618 @comment This section copied to the Getting started with rcirc section
619 @kindex C-c C-SPC
620 @vindex rcirc-track-minor-mode
621 @cindex switching channels
622 @cindex tracking activity
623 @cindex active channel
624 @cindex abbreviated channel names
625 @cindex modeline tracks activity
626 Most people want a notification when something is said on a channel they
627 have joined, particularly if they have been addressed directly. There
628 is a global minor mode that will do this kind of tracking for you. All
629 you need to do is switch it on using @kbd{M-x rcirc-track-minor-mode}.
630 To make this permanent, add the following to your init file:
631
632 @example
633 (rcirc-track-minor-mode 1)
634 @end example
635
636 When other people say things in buffers that are currently buried (no
637 window is showing them), the mode line will now show you the abbreviated
638 channel or nick name. Use @kbd{C-c C-@key{SPC}} to switch to these
639 buffers.
640
641 @vindex rcirc-mode-hook
642 If you prefer not to load @code{rcirc} immediately, you can delay the
643 activation of this mode:
644
645 @example
646 (add-hook 'rcirc-mode-hook
647 (lambda ()
648 (rcirc-track-minor-mode 1)))
649 @end example
650
651 @cindex busy channels
652 If you've joined a very active support channel, tracking activity is
653 no longer useful. The channel will be always active. Switching to
654 active channels using @kbd{C-c C-@key{SPC}} no longer works as
655 expected.
656
657 @kindex C-c C-l
658 @cindex low priority channels
659 The solution is to mark this channel as a low priority channel.
660 Use @kbd{C-c C-l} to make the current channel a low-priority channel.
661 Low priority channels have the modeline indicator ``LowPri''.
662 @kbd{C-c C-@key{SPC}} will not switch to low priority channels unless
663 you use the @kbd{C-u} prefix.
664
665 @kindex C-c TAB
666 @cindex ignored channels
667 If you prefer a channel to never show up in the modeline, then you
668 have to ignore it. Use @kbd{C-c @key{TAB}} to ignore the current
669 channel.
670
671 @node People
672 @section People
673 @cindex people, how to ignore
674 @cindex nicks, how to ignore
675 @cindex friends
676 @cindex buddies
677 @cindex trolls
678
679 The most important command available to the discerning IRC user is
680 @code{/ignore}. It's the big equalizer online: If people aggravate
681 you, just ignore them.
682
683 This is of course a crude all-or-nothing solution. Fear not,
684 @code{rcirc} offers alternatives: You can ``brighten'' your buddies
685 and ``dim'' certain other nicks that you don't want to ignore
686 altogether.
687
688 @table @code
689 @item /ignore
690 @cindex /ignore
691 @cindex ignoring other people
692 @cindex trolls, ignoring
693 @cindex hide some posts
694 @cindex idiots online
695 This command toggles the ignore status of a nick, if you provide one.
696 If you don't provide a nick, the command lists all the nicks you are
697 ignoring. All messages by ignored nicks are---you guessed it---ignored.
698 Since only ``operators'' can kick people from channels, the
699 ignore command is often the only way to deal with some of the more
700 obnoxious fellows online. Example: @code{/ignore rudybot}.
701
702 @item /bright
703 @cindex /bright
704 @cindex highlight other people
705 @cindex friends, highlight
706 @cindex buddies, highlight
707 @cindex nicks, highlight
708 @cindex brighten nicks
709 This command toggles the bright status of a nick, if you provide one.
710 If you don't provide a nick, the command lists all the ``brightened''
711 nicks. All messages by brightened nicks are---you guessed
712 it---brightened. Use this for your friends. Example: @code{/bright
713 rcy}.
714
715 @item /dim
716 @cindex /dim
717 @cindex soft-ignore other people
718 @cindex obnoxious people online
719 @cindex rabble online
720 This command toggles the dim status of a nick, if you provide one. If
721 you don't provide a nick, the command lists all the ``dimmed'' nicks.
722 All messages by dimmed nicks are---you guessed it---dimmed. Use this
723 for boring people and bots. If you are tracking channel activity,
724 messages by dimmed nicks will not register as activity. Example:
725 @code{/dim fsbot}.
726 @end table
727
728
729 @node Keywords
730 @section Keywords
731 @cindex keywords
732
733 On a busy channel, you might want to ignore all activity (using
734 @kbd{C-c @key{TAB}}) and just watch for certain keywords. The
735 following command allows you to highlight certain keywords:
736
737 @table @code
738 @item /keyword
739 @cindex /keyword
740 This command toggles the highlighting of a keyword, if you provide
741 one. If you don't provide a keyword, the current keywords are
742 listed. Example: @code{/keyword manual}.
743 @end table
744
745 @node Notices
746 @section Notices
747 @cindex part notices, how to omit
748 @cindex join notices, how to omit
749 @cindex quit notices, how to omit
750 @cindex nick notices, how to omit
751
752 @kindex C-c C-o
753 @cindex low priority channels
754 In busy channels you might not be interested in all the joining,
755 parting, quitting, and renaming that goes on. You can omit those
756 notices using @kbd{C-c C-o}.
757
758 @vindex rcirc-omit-responses
759 @cindex away notices, how to omit
760 You can control which notices get omitted via the
761 @code{rcirc-omit-responses} variable. Here's an example of how to
762 omit away messages:
763
764 @example
765 (setq rcirc-omit-responses '("JOIN" "PART" "QUIT" "NICK" "AWAY"))
766 @end example
767
768 @vindex rcirc-omit-threshold
769 Notice that these messages will not be omitted if the nick in question
770 has recently been active. After all, you don't want to continue a
771 conversation with somebody who just left. That's why @code{rcirc}
772 checks recent lines in the buffer to figure out if a nick has been
773 active and only omits a message if the nick has not been active. The
774 window @code{rcirc} considers is controlled by the
775 @code{rcirc-omit-threshold} variable.
776
777 @node Hacking and Tweaking
778 @chapter Hacking and Tweaking
779 @cindex hacking and tweaking
780
781 Here are some examples of stuff you can do to configure @code{rcirc}.
782
783 @menu
784 * Skipping /away messages using handlers::
785 * Using fly spell mode::
786 * Scrolling conservatively::
787 * Changing the time stamp format::
788 * Defining a new command::
789 * Reconnecting after you have lost the connection::
790 @end menu
791
792 @node Skipping /away messages using handlers
793 @section Skipping @code{/away} messages using handlers
794 @cindex /away messages
795
796 @cindex handlers
797 @cindex status codes
798 The IRC protocol specifies how certain events are signaled from server
799 to client. These events have numbers and are dealt with using so-called
800 handlers. You can override existing handlers by exploiting the naming
801 convention adopted for @code{rcirc}.
802
803 Here's how to stop @code{rcirc} from printing @code{/away} messages.
804 Since @code{rcirc} doesn't define a 301 handler, you don't need to
805 require @code{rcirc} before defining the handler:
806
807 @example
808 (defun rcirc-handler-301 (process cmd sender args)
809 "/away message handler.")
810 @end example
811
812 @node Using fly spell mode
813 @section Using fly spell mode
814 @cindex fly spell
815 @cindex spelling
816 @cindex spell-checking as you type
817 @cindex automatic spelling
818 @vindex rcirc-mode-hook
819
820 The following code activates Fly Spell Mode
821 for @code{rcirc} buffers:
822
823 @example
824 (add-hook 'rcirc-mode-hook (lambda ()
825 (flyspell-mode 1)))
826 @end example
827
828 @xref{Spelling, , Flyspell mode, emacs, The GNU Emacs Manual},
829 for details.
830
831 @node Scrolling conservatively
832 @section Scrolling conservatively
833 @cindex input line
834 @cindex scrolling
835 @vindex scroll-conservatively
836 @vindex rcirc-mode-hook
837
838 IRC buffers are constantly growing. If you want to see as much as
839 possible at all times, you would want the prompt at the bottom of the
840 window when possible. The following snippet uses a local value for
841 @code{scroll-conservatively} to achieve this:
842
843 @example
844 (add-hook 'rcirc-mode-hook
845 (lambda ()
846 (set (make-local-variable 'scroll-conservatively)
847 8192)))
848 @end example
849
850 @xref{Scrolling, , Scrolling conservatively, emacs, The GNU Emacs
851 Manual}, for details.
852
853 @node Changing the time stamp format
854 @section Changing the time stamp format
855 @cindex time stamp
856 @cindex date time
857 @cindex format time stamp
858 @vindex rcirc-time-format
859
860 @code{rcirc-time-format} is the format used for the time stamp. Here's
861 how to include the date in the time stamp:
862
863 @example
864 (setq rcirc-time-format "%Y-%m-%d %H:%M ")
865 @end example
866
867 @node Defining a new command
868 @section Defining a new command
869 @cindex defining commands
870 @cindex commands, defining
871 @cindex new commands, defining
872
873 Here's a simple new command, @code{/sv}. With it, you can boast about
874 your IRC client. It shows how you can use @code{defun-rcirc-command} to
875 define new commands.
876
877 We're waiting for the definition of this command until @code{rcirc} is loaded
878 because @code{defun-rcirc-command} is not yet available, and without
879 @code{rcirc} loaded, the command wouldn't do us much good anyway.
880
881 @smallexample
882 (eval-after-load 'rcirc
883 '(defun-rcirc-command sv (arg)
884 "Boast about rcirc."
885 (interactive "i")
886 (rcirc-send-message process target
887 (concat "I use " rcirc-id-string))))
888 @end smallexample
889
890 @node Reconnecting after you have lost the connection
891 @section Reconnecting after you have lost the connection
892 @cindex reconnecting
893 @cindex disconnecting servers, reconnecting
894
895 If you're chatting from a laptop, then you might be familiar with this
896 problem: When your laptop falls asleep and wakes up later, your IRC
897 client doesn't realize that it has been disconnected. It takes several
898 minutes until the client decides that the connection has in fact been
899 lost. The simple solution is to use @kbd{M-x rcirc}. The problem is
900 that this opens an @emph{additional} connection, so you'll have two
901 copies of every channel buffer, one dead and one live.
902
903 The real answer, therefore, is a @code{/reconnect} command:
904
905 @smallexample
906 (eval-after-load 'rcirc
907 '(defun-rcirc-command reconnect (arg)
908 "Reconnect the server process."
909 (interactive "i")
910 (unless process
911 (error "There's no process for this target"))
912 (let* ((server (car (process-contact process)))
913 (port (process-contact process :service))
914 (nick (rcirc-nick process))
915 channels query-buffers)
916 (dolist (buf (buffer-list))
917 (with-current-buffer buf
918 (when (eq process (rcirc-buffer-process))
919 (remove-hook 'change-major-mode-hook
920 'rcirc-change-major-mode-hook)
921 (if (rcirc-channel-p rcirc-target)
922 (setq channels (cons rcirc-target channels))
923 (setq query-buffers (cons buf query-buffers))))))
924 (delete-process process)
925 (rcirc-connect server port nick
926 rcirc-default-user-name
927 rcirc-default-full-name
928 channels))))
929 @end smallexample
930
931 @node GNU Free Documentation License
932 @appendix GNU Free Documentation License
933 @include doclicense.texi
934
935
936 @node Key Index
937 @unnumbered Key Index
938 @printindex ky
939
940 @node Variable Index
941 @unnumbered Variable Index
942 @printindex vr
943
944 @node Index
945 @unnumbered Index
946 @printindex cp
947
948 @bye