Remove references to external license, since doclicense is included.
[bpt/emacs.git] / doc / misc / rcirc.texi
CommitLineData
4009494e
GM
1\input texinfo
2@c %**start of header
db78a8cb 3@setfilename ../../info/rcirc
4009494e
GM
4@settitle rcirc Manual
5@c %**end of header
6
7@copying
3f548a7c 8Copyright @copyright{} 2006, 2007, 2008 Free Software Foundation, Inc.
4009494e
GM
9
10@quotation
11Permission is granted to copy, distribute and/or modify this document
12under the terms of the GNU Free Documentation License, Version 1.2 or
13any later version published by the Free Software Foundation; with no
14Invariant Sections, with the Front-Cover texts being ``A GNU Manual'',
15and with the Back-Cover Texts as in (a) below. A copy of the license is
debf4439 16included in the section entitled ``GNU Free Documentation License''.
4009494e 17
6f093307
GM
18(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
19modify this GNU manual. Buying copies from the FSF supports it in
20developing GNU and promoting software freedom.''
4009494e
GM
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
43IRC (Internet Relay Chat) is a multi-user chat protocol. Users
44communicate with each other in real-time. Communication occurs both in
45topic channels which are collections of many users, or privately, with
46just one other user.
47
48@menu
49* Basics::
50* Reference::
331e4d02 51* Fighting Information Overload::
4009494e
GM
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
61Basics
62
63* Internet Relay Chat::
64* Getting started with rcirc::
65
66Reference
67
68* rcirc commands::
69* Useful IRC commands::
70* Configuration::
71
331e4d02
AS
72Fighting Information Overload
73
74* Channels::
75* People::
76* Keywords::
77* Notices::
78
4009494e
GM
79Hacking 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
94This chapter contains a brief introduction to IRC (Internet Relay Chat),
95and 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
109Internet. It is mainly designed for group (many-to-many) communication
110in discussion forums called channels, but also allows one-to-one
111communication.
112
113@cindex instant messaging, comparison
114@cindex server
115@cindex network
116Contrary to most Instant Messenger (IM) systems, users usually don't
99a3e35f
AS
117connect to a central server. Instead, users connect to a random
118server in a network, and servers relay messages from one to the next.
4009494e
GM
119
120Here's a typical example:
121
122@cindex redirection to random servers
123When you connect to the Freenode network
124(@code{http://freenode.net/}), you point your IRC client at the
125server @code{irc.freenode.net}. That server will redirect your client
126to a random server on the network, such as @code{zelazny.freenode.net}.
127
128@cindex channel name
129@cindex # starts a channel name
130Once you're connected, you can send messages to all other users
131connected to the same network, and you can join all channels on the same
132network. You might join the @code{#emacs} and the @code{#rcirc}
133channels, for example. (Typically, channel names begin with a hash
134character.)
135
136Once you have joined a channel, anything you type will be broadcast to
137all 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
142If you want to address someone specifically, for example as an answer to
143a question, it is customary to prefix the message with the nick followed
144by a colon, like this:
145
146@example
147deego: fsbot rules!
148@end example
149
150@cindex nick completion
151@cindex completion of nicks
152@kindex TAB
153Since 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
161Use the command @kbd{M-x irc} to connect using the defaults.
162@xref{Configuration}, if you want to change the defaults.
163
164Use @kbd{C-u M-x irc} if you don't want to use the defaults, eg. if you
165want to connect to a different network, or connect to the same network
166using a different nick. This will prompt you for four things:
167
168@table @asis
169@cindex server, connecting
170@cindex Freenode network
99a3e35f 171@item IRC Server
4009494e
GM
172What server do you want to connect to? All the servers in a particular
173network are equivalent. Some networks use a round-robin system where a
174single server redirects new connections to a random server in the
175network. @code{irc.freenode.net} is such a server for the Freenode
176network. Freenode provides the network ``for the Free and Open Source
177Software communities, for not-for-profit organisations and for related
178communities and organizations.''
179
180@cindex port, connecting
181@cindex 6667, default IRC port
99a3e35f 182@item IRC Port
4009494e
GM
183All network connections require a port. Just as web servers and clients
184use port 80 per default, IRC uses port 6667 per default. You rarely
185have to use a different port.
186
187@cindex nick, connecting
188@cindex changing nick
189@cindex name changes
99a3e35f 190@item IRC Nick
4009494e
GM
191@vindex user-login-name
192Every users needs a handle on-line. You will automatically be assigned
193a slightly different nick if your chosen nick is already in use. If
194your @code{user-login-name} is @code{alex}, and this nick is already
195in use, you might for example get assigned the nick @code{alex`}.
196
197@cindex channels, connecting
198@cindex initial channels
199@cindex startup channels
99a3e35f 200@item IRC Channels
4009494e
GM
201A space separated list of channels you want to join when connecting.
202You don't need to join any channels, if you just want to have one-to-one
203conversations with friends on the same network. If you're new to the
204Freenode network, join @code{#emacs}, the channel about all things
205Emacs, or join @code{#rcirc}, the channel about @code{rcirc}.
206@end table
207
208@cindex server buffer
209When you have answered these questions, @code{rcirc} will create a server
210buffer, which will be named something like @code{*irc.freenode.net*},
211and a channel buffer for each of the channels you wanted to join.
212
213@kindex RET
214@cindex talking
215@cindex communicating
99a3e35f 216To talk in a channel, just type what you want to say in a channel
4009494e
GM
217buffer, 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
224If 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
226C-c} to finish editing. You still need to press @key{RET} to send it,
227though. Generally, IRC users don't like people pasting more than around
228four lines of code, so use with care.
229
99a3e35f
AS
230@comment This section copied from the Channels section.
231@comment All index markers should point to the original!
232Once you are connected to multiple channels, or once you've turned you
233attention to other buffers in Emacs, you probably want to be notified
234of any activity in channels not currently visible. All you need to do
235is switch channel tracking on using @kbd{M-x rcirc-track-minor-mode}.
236To make this permanent, add the following to your init file:
331e4d02
AS
237
238@example
239(rcirc-track-minor-mode 1)
240@end example
241
99a3e35f
AS
242Use @kbd{C-c C-@key{SPC}} to switch to these buffers.
243
331e4d02 244@node Reference, Fighting Information Overload, Basics, Top
4009494e
GM
245@chapter Reference
246@cindex reference
247
248This is the reference section of the manual. It is not complete. For
249complete listings of @code{rcirc} features, use Emacs built-in
250documentation.
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
264This is a list of commands that you may use in @code{rcirc}. It is not
265complete. For a complete listing, press @kbd{C-h m} in an @code{rcirc}
266buffer.
267
268In addition to using regular Emacs key bindings, you can call them by
269typing them into an @code{rcirc} buffer.
270
271@cindex call commands
272@cindex typing commands
273@cindex commands
274For instance, instead of using the command @kbd{C-c C-j} to join a new
275channel, 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
285This is why you cannot start a message with a slash. You will have to
286precede the command with a space, or rewrite your message in order to
287send it to a channel.
288
289@cindex multiple words as parameters
290@cindex string delimiters
291@cindex quotes
292@cindex double-quotes
293Many commands take parameters. IRC commands usually ignore string
294delimiters. Neither quote nor double-quote have special meanings in
295IRC.
296
297@example
298/nick "alex schroeder"
299@end example
300
301This will try to change your nick to @code{"alex}. Usually this will
a7d51a21 302fail because the double quote character is not a valid character for
4009494e
GM
303nicks.
304
305@cindex case insensitive commands
306These commands are case insensitive.
307
308@cindex new command
309@cindex unknown command
310@cindex command unknown
311If a command isn't known by @code{rcirc}, it will simply be sent along to the
312server. There is a list of some useful commands like that in the next
313section.
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
323This joins a channel such as @code{#rcirc} or @code{#emacs}. On most
324networks, anybody can create new channels. If you want to talk with
325some friends, for example, all you have to do is agree on a valid
326channel 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
336This leaves the current channel. You can optionally provide a reason
337for parting. When you kill a channel buffer, you automatically part the
338corresponding 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
347This changes your nick to some other name. Your nick must be unique
348across the network. Most networks don't allow too many nick changes in
349quick succession, and have restrictions on the valid characters in nick
350names. (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
359Gives you some basic information about a nick. This often includes what
360other 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
371Starts a one-to-one conversation with another person on the same
372network. A new buffer will be created for this conversation. It works
373like 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
380This sends a single message to a nick. Like with @kbd{C-c C-q}, a new
381buffer is created, where the response from the other party will show
382up. (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
395This disconnects from the server and parts all channels. You can
396optionally provide a reason for quitting. When you kill the server
397buffer, you automatically quit the server and part all channels. (Also
398@code{/quit ZZZzzz...}.)
399@end table
400
4009494e
GM
401@node Useful IRC commands, Configuration, rcirc commands, Reference
402@section Useful IRC commands
403@cindex irc commands
404@cindex commands
405
406As mentioned, if a command isn't known by @code{rcirc}, it will simply be sent
407along to the server. Some such commands are available on nearly all IRC
408servers, 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
417This sets your status as ``being away'' if you provide a reason, or sets
418your 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
424Typical IRC servers implement many more commands. You can read more
425about the fantastic world of IRC online at
426@uref{http://www.irchelp.org/, the Internet Relay Chat (IRC) help
427archive}.
428
429@node Configuration, , Useful IRC commands, Reference
430@section Configuration
431@cindex configuring rcirc
432
433These are some variables you can change to configure @code{rcirc} to your
434liking.
435
436@table @code
125a630f
AS
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
99a3e35f
AS
445This variable contains an alist of servers to connect to by default
446and the keywords parameters to use. The keyword parameters are
447optional. If you don't provide any, the defaults as documented below
448will be used.
4009494e 449
99a3e35f 450The most important parameter is the @code{:channels} parameter. It
125a630f
AS
451controls which channels you will join by default as soon as you are
452connected to the server.
453
454Here'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
462By 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
467This overrides @code{rcirc-default-nick}.
468
469@item :port
470This overrides @code{rcirc-default-port}.
471
472@item :user-name
473This overrides @code{rcirc-default-user-name}.
474
475@item :full-name
476This overrides @code{rcirc-default-full-name}.
477
478@item :channels
99a3e35f
AS
479This describes which channels to join when connecting to the server.
480If absent, no channels will be connected to automatically.
125a630f
AS
481
482@end table
4009494e
GM
483
484@item rcirc-default-nick
485@vindex rcirc-default-nick
99a3e35f 486This variable is used for the default nick. It defaults to the login
125a630f 487name returned by @code{user-login-name}.
4009494e
GM
488
489@example
125a630f 490(setq rcirc-default-nick "kensanata")
4009494e
GM
491@end example
492
125a630f
AS
493@item rcirc-default-port
494@vindex rcirc-default-port
495@cindex port
99a3e35f 496This variable contains the default port to connect to. It is 6667 by
125a630f
AS
497default and rarely needs changing.
498
499@item rcirc-default-user-name
500@vindex rcirc-default-user-name
501@cindex user name
99a3e35f
AS
502This variable contains the default user name to report to the server.
503It defaults to the login name returned by @code{user-login-name}, just
504like @code{rcirc-default-nick}.
125a630f
AS
505
506@item rcirc-default-user-full-name
4009494e
GM
507@vindex rcirc-default-user-full-name
508@cindex full name
509@cindex real name
510@cindex surname
99a3e35f
AS
511This variable is used to set your ``real name'' on IRC. It defaults
512to the name returned by @code{user-full-name}. If you want to hide
513your full name, you might want to set it to some pseudonym.
4009494e
GM
514
515@example
516(setq rcirc-default-user-full-name "Curious Minds Want To Know")
517@end example
518
125a630f 519@item rcirc-authinfo
4009494e
GM
520@vindex rcirc-authinfo
521@cindex authentification
522@cindex identification
523@cindex nickserv
524@cindex login
125a630f 525This variable is an alist used to automatically identify yourself on
99a3e35f
AS
526networks. Each sublist starts with a regular expression that is
527compared to the server address you're connecting to. The second
528element in the list is a symbol representing the method to use,
529followed by the arguments this method requires.
4009494e
GM
530
531Here 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
540And here are the valid method symbols and the arguments they require:
541
542@table @code
543@item nickserv
544@cindex nickserv authentification
545Use this symbol if you need to identify yourself as follows when
546connecting to a network: @code{/msg nickserv identify secret}. The
547necessary arguments are the nickname you want to use this for, and the
548password to use.
549
550Before you can use this method, you will have to register your nick and
551pick a password for it. Contact @code{nickserv} and check out the
552details. (Using @code{/msg nickserv help}, for example.)
553
554@item chanserv
555@cindex chanserv authentification
556Use this symbol if you need to identify yourself as follows if you want
557to join a particular channel: @code{/msg chanserv identify #underground
558secret}. The necessary arguments are the nickname and channel you want
559to use this for, and the password to use.
560
561Before you can use this method, a channel contact must tell you about
562the 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
567Use this symbol if you need to identify yourself in the Bitlbee channel
568as follows: @code{identify secret}. The necessary arguments are the
569nickname 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!
578Bitlbee acts like an IRC server, but in fact it is a gateway to a lot of
579other instant messaging services. You can either install Bitlbee
580locally or use a public Bitlbee server. There, you need to create an
581account with a password. This is the nick and password you need to
582provide for the bitlbee authentification method.
583
584Later, you will tell Bitlbee about your accounts and passwords on all
585the 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
587confuse the Bitlbee account with all the other accounts.
331e4d02 588
4009494e
GM
589@end table
590
125a630f
AS
591@end table
592
331e4d02
AS
593@node Fighting Information Overload, Hacking and Tweaking, Reference, Top
594@chapter Fighting Information Overload
595@cindex information overload
596
597This is the section of the manual that caters to the busy person
99a3e35f
AS
598online. There are support channels with several hundred people in
599them. Trying to follow a conversation in these channels can be a
600daunting task. This chapters tells you how @code{rcirc} can help.
331e4d02
AS
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
99a3e35f 614@comment This section copied to the Getting started with rcirc section
4009494e
GM
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
622Most people want a notification when something is said on a channel they
623have joined, particularly if they have been addressed directly. There
624is a global minor mode that will do this kind of tracking for you. All
625you need to do is switch it on using @kbd{M-x rcirc-track-minor-mode}.
626To make this permanent, add the following to your init file:
627
628@example
629(rcirc-track-minor-mode 1)
630@end example
631
632When other people say things in buffers that are currently buried (no
633window is showing them), the mode line will now show you the abbreviated
634channel or nick name. Use @kbd{C-c C-@key{SPC}} to switch to these
635buffers.
636
637@vindex rcirc-mode-hook
638If you prefer not to load @code{rcirc} immediately, you can delay the
639activation of this mode:
640
641@example
642(add-hook 'rcirc-mode-hook
643 (lambda ()
644 (rcirc-track-minor-mode 1)))
645@end example
646
331e4d02
AS
647@cindex busy channels
648If you've joined a very active support channel, tracking activity is
99a3e35f 649no longer useful. The channel will be always active. Switching to
331e4d02
AS
650active channels using @kbd{C-c C-@key{SPC}} no longer works as
651expected.
652
653@kindex C-c C-l
654@cindex low priority channels
655The solution is to mark this channel as as a low priority channel.
99a3e35f
AS
656Use @kbd{C-c C-l} to make the current channel a low-priority channel.
657Low priority channels have the modeline indicator ``LowPri''.
331e4d02
AS
658@kbd{C-c C-@key{SPC}} will not switch to low priority channels unless
659you use the @kbd{C-u} prefix.
660
661@kindex C-c TAB
662@cindex ignored channels
663If you prefer a channel to never show up in the modeline, then you
99a3e35f 664have to ignore it. Use @kbd{C-c @key{TAB}} to ignore the current
331e4d02
AS
665channel.
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
675The most important command available to the discerning IRC user is
99a3e35f 676@code{/ignore}. It's the big equalizer online: If people aggravate
331e4d02
AS
677you, just ignore them.
678
679This is of course a crude all-or-nothing solution. Fear not,
680@code{rcirc} offers alternatives: You can ``brighten'' your buddies
681and ``dim'' certain other nicks that you don't want to ignore
682altogether.
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
691This command toggles the ignore status of a nick, if you provide one.
692If you don't provide a nick, the command lists all the nicks you are
693ignoring. All messages by ignored nicks are---you guessed it---ignored.
694Since only ``operators'' can kick people from channels, the
695ignore command is often the only way to deal with some of the more
11ac7c8e 696obnoxious fellows online. Example: @code{/ignore rudybot}.
331e4d02
AS
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
705This command toggles the bright status of a nick, if you provide one.
706If you don't provide a nick, the command lists all the ``brightened''
707nicks. All messages by brightened nicks are---you guessed
99a3e35f 708it---brightened. Use this for your friends. Example: @code{/bright
331e4d02
AS
709rcy}.
710
711@item /dim
712@cindex /dim
713@cindex soft-ignore other people
714@cindex obnoxious people online
715@cindex rabble online
716This command toggles the dim status of a nick, if you provide one. If
717you don't provide a nick, the command lists all the ``dimmed'' nicks.
718All messages by dimmed nicks are---you guessed it---dimmed. Use this
99a3e35f
AS
719for boring people and bots. If you are tracking channel activity,
720messages by dimmed nicks will not register as activity. Example:
331e4d02
AS
721@code{/dim fsbot}.
722@end table
723
724
725@node Keywords, Notices, People, Fighting Information Overload
726@section Keywords
727@cindex keywords
728
729On a busy channel, you might want to ignore all activity (using
99a3e35f 730@kbd{C-c @key{TAB}}) and just watch for certain keywords. The
331e4d02
AS
731following command allows you to highlight certain keywords:
732
733@table @code
734@item /keyword
735@cindex /keyword
736This command toggles the highlighting of a keyword, if you provide
99a3e35f
AS
737one. If you don't provide a keyword, the current keywords are
738listed. Example: @code{/keyword manual}.
331e4d02
AS
739@end table
740
331e4d02
AS
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
750In busy channels you might not be interested in all the joining,
99a3e35f 751parting, quitting, and renaming that goes on. You can omit those
331e4d02
AS
752notices using @kbd{C-c C-o}.
753
754@vindex rcirc-omit-responses
755@cindex away notices, how to omit
756You can control which notices get omitted via the
99a3e35f
AS
757@code{rcirc-omit-responses} variable. Here's an example of how to
758omit away messages:
331e4d02
AS
759
760@example
761(setq rcirc-omit-responses '("JOIN" "PART" "QUIT" "NICK" "AWAY))
762@end example
763
764@vindex rcirc-omit-threshold
765Notice that these messages will not be omitted if the nick in question
99a3e35f
AS
766has recently been active. After all, you don't want to continue a
767conversation with somebody who just left. That's why @code{rcirc}
331e4d02 768checks recent lines in the buffer to figure out if a nick has been
99a3e35f 769active and only omits a message if the nick has not been active. The
331e4d02
AS
770window @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
4009494e
GM
774@chapter Hacking and Tweaking
775@cindex hacking and tweaking
776
777Here 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
794The IRC protocol specifies how certain events are signaled from server
795to client. These events have numbers and are dealt with using so-called
796handlers. You can override existing handlers by exploiting the naming
797convention adopted for @code{rcirc}.
798
799Here's how to stop @code{rcirc} from printing @code{/away} messages.
800Since @code{rcirc} doesn't define a 301 handler, you don't need to
801require @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
816The following code activates Fly Spell Mode
817for @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},
825for 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
834IRC buffers are constantly growing. If you want to see as much as
835possible at all times, you would want the prompt at the bottom of the
836window 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
847Manual}, 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
857how 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
869Here's a simple new command, @code{/sv}. With it, you can boast about
870your IRC client. It shows how you can use @code{defun-rcirc-command} to
871define new commands.
872
873We're waiting for the definition of this command until @code{rcirc} is loaded
874because @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
891If you're chatting from a laptop, then you might be familiar with this
892problem: When your laptop falls asleep and wakes up later, your IRC
893client doesn't realise that it has been disconnected. It takes several
894minutes until the client decides that the connection has in fact been
895lost. The simple solution is to use @kbd{M-x rcirc}. The problem is
896that this opens an @emph{additional} connection, so you'll have two
897copies of every channel buffer --- one dead and one live.
898
899The 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