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