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