3 @setfilename ../info/rcirc
8 Copyright (C) 2006 Free Software Foundation, Inc.
11 Permission is granted to copy, distribute and/or modify this document
12 under the terms of the GNU Free Documentation License, Version 1.2 or
13 any later version published by the Free Software Foundation; with no
14 Invariant Sections, with the Front-Cover texts being ``A GNU Manual'',
15 and with the Back-Cover Texts as in (a) below. A copy of the license is
16 included in the section entitled ``GNU Free Documentation License'' in
19 (a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
20 this GNU Manual, like GNU software. Copies published by the Free
21 Software Foundation raise funds for GNU development.''
23 This document is part of a collection distributed under the GNU Free
24 Documentation License. If you want to distribute this document
25 separately from the collection, you can do so by adding a copy of the
26 license to the document, as described in section 6 of the license.
32 * Rcirc: (rcirc). Internet Relay Chat (IRC) client.
38 @vskip 0pt plus 1filll
43 @node Top, Basics, (dir), (dir)
47 @code{rcirc} is an Emacs IRC client.
49 IRC (Internet Relay Chat) is a multi-user chat protocol. Users
50 communicate with each other in real-time. Communication occurs both in
51 topic channels which are collections of many users, or privately, with
57 * Hacking and Tweaking::
63 --- The Detailed Node Listing ---
67 * Internet Relay Chat::
68 * Getting started with rcirc::
73 * Useful IRC commands::
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::
88 @node Basics, Reference, Top, Top
91 This chapter contains a brief introduction to IRC (Internet Relay Chat),
92 and a quick tutorial on @code{rcirc}.
95 * Internet Relay Chat::
96 * Getting started with rcirc::
99 @node Internet Relay Chat, Getting started with rcirc, Basics, Basics
100 @section Internet Relay Chat
101 @cindex internet relay chat
105 @dfn{Internet Relay Chat} (IRC) is a form of instant communication over the
106 Internet. It is mainly designed for group (many-to-many) communication
107 in discussion forums called channels, but also allows one-to-one
110 @cindex instant messaging, comparison
113 Contrary to most Instant Messenger (IM) systems, users usually don't
114 connect to a central server. Instead, users connect to a random server
115 in a network, and the servers share information between them.
117 Here's a typical example:
119 @cindex redirection to random servers
120 When you connect to the Freenode network
121 (@indicateurl{http://freenode.net/}), you point your IRC client at the
122 server @code{irc.freenode.net}. That server will redirect your client
123 to a random server on the network, such as @code{zelazny.freenode.net}.
126 @cindex # starts a channel name
127 Once you're connected, you can send messages to all other users
128 connected to the same network, and you can join all channels on the same
129 network. You might join the @code{#emacs} and the @code{#rcirc}
130 channels, for example. (Typically, channel names begin with a hash
133 Once you have joined a channel, anything you type will be broadcast to
134 all the other users on the same channel.
136 @cindex addressing other people
137 @cindex other people, addressing them
138 @cindex talk to other people
139 If you want to address someone specifically, for example as an answer
140 to a question, it is custom to prefix the message with the nick
141 followed by a colon, like this:
147 @cindex nick completion
148 @cindex completion of nicks
150 Since this is so common, you can use @key{TAB} to do nick completion.
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
158 Use the command @kbd{M-x irc} to connect to a server. You will be asked
162 @cindex server, connecting
163 @cindex Freenode network
165 What server do you want to connect to? All the servers in a particular
166 network are equivalent. Some networks use a round-robin system where a
167 single server redirects new connections to a random server in the
168 network. @code{irc.freenode.net} is such a server for the Freenode
169 network. Freenode provides the network ``for the Free and Open Source
170 Software communities, for not-for-profit organisations and for related
171 communities and organizations.''
173 @cindex port, connecting
174 @cindex 6667, default IRC port
176 All network connections require a port. Just as web servers and clients
177 use port 80 per default, IRC uses port 6667 per default. You rarely
178 have to use a different port.
180 @cindex nick, connecting
181 @cindex changing nick
184 @vindex user-login-name
185 Every users needs a handle on-line. You will automatically be assigned
186 a slightly different nick if your chosen nick is already in use. If
187 your @code{user-login-name} is @code{"alex"}, and this nick is already
188 in use, you might for example get assigned the nick @code{alex`}.
190 @cindex channels, connecting
191 @cindex initial channels
192 @cindex startup channels
194 A space separated list of channels you want to join when connecting.
195 You don't need to join any channels, if you just want to have one-to-one
196 conversations with friends on the same network. If you're new to the
197 Freenode network, join @code{#emacs}, the about all things Emacs.
200 @cindex server buffer
201 When you have answered these questions, @code{rcirc} will create a server
202 buffer, which will be named something like @code{*irc.freenode.net*},
203 and a channel buffer for each of the channels you wanted to join.
207 @cindex communicating
208 To talk in a channel, just type in what you want to say in a channel
209 buffer, and press @key{RET}.
212 @cindex multiline messages
213 @cindex messages, multiple lines
214 @cindex pasting multiple lines
215 @cindex edit message before sending
216 If 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
218 C-c} to finish editing. You still need to press @key{RET} to send it,
219 though. Generally, IRC users don't like people pasting more than around
220 four lines of code, so use with care.
223 @cindex switching channels
224 @cindex tracking activity
225 @cindex active channel
226 @cindex abbreviated channel names
227 @cindex modeline tracks activity
228 You will note that when other people say things in buffers that are
229 currently buried (no window is showing them), the mode line will show
230 you the abbreviated channel or nick name. Use @kbd{C-c C-@key{SPC}} to switch
233 @node Reference, Hacking and Tweaking, Basics, Top
237 This is the reference section of the manual. It is not complete. For
238 complete listings of @code{rcirc} features, use Emacs built-in
243 * Useful IRC commands::
247 @node rcirc commands, Useful IRC commands, Reference, Reference
248 @section rcirc commands
249 @cindex rcirc commands
253 This is a list of commands that you may use in @code{rcirc}. It is not
254 complete. For a complete listing, press @kbd{C-h m} in an @code{rcirc}
257 In addition to using regular Emacs key bindings, you can call them by
258 typing them into an @code{rcirc} buffer.
260 @cindex call commands
261 @cindex typing commands
263 For instance, instead of using the command @kbd{C-c C-j} to join a new
264 channel, you may type this in an @code{rcirc} buffer, and press @key{RET}:
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
274 This is why you cannot start a message with a slash. You will have to
275 precede the command with a space, or rewrite your message in order to
276 send it to a channel.
278 @cindex multiple words as parameters
279 @cindex string delimiters
281 @cindex double-quotes
282 Many commands take parameters. IRC commands usually ignore string
283 delimiters. Neither quote nor double-quote have special meanings in
287 /nick "alex schroeder"
290 This will try to change your nick to @code{"alex}. Usually this will
291 fail because the double quote character is not a legal character for
294 @cindex case insensitive commands
295 These commands are case insensitive.
298 @cindex unknown command
299 @cindex command unknown
300 If a command isn't known by @code{rcirc}, it will simply be sent along to the
301 server. There is a list of some useful commands like that in the next
308 @cindex join channels
309 @cindex other channels
310 @cindex rooms, joining
311 @cindex discussion, joining
312 This joins a channel such as @code{#rcirc} or @code{#emacs}. On most
313 networks, anybody can create new channels. If you want to talk with
314 some friends, for example, all you have to do is agree on a valid
315 channel name and join that channel. (Also @code{/join #emacs}.)
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
325 This leaves the current channel. You can optionally provide a reason
326 for parting. When you kill a channel buffer, you automatically part the
327 corresponding channel. (Also @code{/part you are too weird!}.)
333 @cindex nick changing
334 @cindex rename yourself
336 This changes your nick to some other name. Your nick must be unique
337 across the network. Most networks don't allow too many nick changes in
338 quick succession, and have restrictions on the valid characters in nick
339 names. (Also @code{/nick alex-test})
344 @cindex who are these people
345 @cindex identifying people
346 @cindex channels other people are on
347 @cindex what channels people are on
348 Gives you some basic information about a nick. This often includes what
349 other channels people are on. (Also @code{/whois fsbot}.)
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
360 Starts a one-to-one conversation with another person on the same
361 network. A new buffer will be created for this conversation. It works
362 like a channel with only two members. (Also @code{/query fsbot}.)
367 @cindex single message
368 @cindex message sending
369 This sends a single message to a nick. Like with @kbd{C-c C-q}, a new
370 buffer is created, where the response from the other party will show
371 up. (Also @code{/msg nickserv identify secret}.)
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
384 This disconnects from the server and parts all channels. You can
385 optionally provide a reason for quitting. When you kill the server
386 buffer, you automatically quit the server and part all channels. (Also
387 @code{/quit ZZZzzz...}.)
390 Some commands may not have a key binding, but only be available as typed
396 @cindex ignoring other people
397 @cindex trolls, ignoring
398 @cindex hide some posts
399 @cindex idiots online
400 This command toggles the ignore status of a nick, if you provide one.
401 If you don't provide a nick, the command lists all the nicks you are
402 ignoring. All messages by ignored nicks are---you guessed it---ignored.
403 Since only ``operators'' can kick people from channels, the
404 ignore command is often the only way to deal with some of the more
405 obnoxious fellows online. Example: @code{/ignore xah}.
408 @node Useful IRC commands, Configuration, rcirc commands, Reference
409 @section Useful IRC commands
413 As mentioned, if a command isn't known by @code{rcirc}, it will simply be sent
414 along to the server. Some such commands are available on nearly all IRC
422 @cindex unavailable status
423 @cindex set away status
424 This sets your status as ``being away'' if you provide a reason, or sets
425 your 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}.
429 @cindex irc resources
430 @cindex help about irc
431 Typical IRC servers implement many more commands. You can read more
432 about the fantastic world of IRC online at
433 @indicateurl{http://www.irchelp.org/}, the Internet Relay Chat (IRC)
436 @node Configuration, , Useful IRC commands, Reference
437 @section Configuration
438 @cindex configuring rcirc
440 These are some variables you can change to configure @code{rcirc} to your
446 the default server to connect to.
450 the default port to connect to.
454 the default nick to use.
458 (setq rcirc-server "irc.mozilla.org"
463 @vindex rcirc-user-full-name
467 @code{rcirc-user-full-name} is used to set your ``real name'' on IRC.
468 It defaults to @code{user-full-name}. If you want to hide your full
469 name, you might want to set it to some pseudonym.
472 (setq rcirc-user-full-name "Curious Minds Want To Know")
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
480 when connecting to a particular network. An alist is a list of lists.
481 Each sublist starts with a regular expression that is compared to the
482 server address you're connecting to. The remaining sublist items are
483 the channels to join.
486 (setq rcirc-startup-channels-alist
487 '(("\\.freenode\\.net$" "#emacs" "#rcirc" "#wiki")))
490 Note the subtle problem, here --- IRC clients connect to servers, and
491 there is no way of knowing which servers belong to a particular network.
492 In the example above we're exploiting a naming convention used by within
493 the Freenode network --- all servers within the network have a host in
494 the @code{freenode.net} domain.
496 @node Hacking and Tweaking, Key Index, Reference, Top
497 @chapter Hacking and Tweaking
498 @cindex hacking and tweaking
500 Here are some examples of stuff you can do to configure @code{rcirc}.
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::
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
517 The IRC protocol specifies how certain events are signaled from server
518 to client. These events have numbers and are dealt with using so-called
519 handlers. You can override existing handlers by exploiting the naming
520 convention adopted for @code{rcirc}.
522 Here's how to stop @code{rcirc} from printing @code{/away} messages.
523 Since @code{rcirc} doesn't define a 301 handler, you don't need to
524 require @code{rcirc} before defining the handler:
527 (defun rcirc-handler-301 (process cmd sender args)
528 "/away message handler.")
531 @node Using fly spell mode, Scrolling conservatively, Skipping /away messages using handlers, Hacking and Tweaking
532 @section Using fly spell mode
535 @cindex spell-checking as you type
536 @cindex automatic spelling
537 @vindex rcirc-mode-hook
539 The following code activates Fly Spell Mode
540 for @code{rcirc} buffers:
543 (add-hook 'rcirc-mode-hook (lambda ()
547 @xref{Spelling, , Flyspell mode, emacs, The GNU Emacs Manual},
550 @node Scrolling conservatively, Changing the time stamp format, Using fly spell mode, Hacking and Tweaking
551 @section Scrolling conservatively
554 @vindex scroll-conservatively
555 @vindex rcirc-mode-hook
557 IRC buffers are constantly growing. If you want to see as much as
558 possible at all times, you would want the prompt at the bottom of the
559 window when possible. The following snippet uses a local value for
560 @code{scroll-conservatively} to achieve this:
563 (add-hook 'rcirc-mode-hook
565 (set (make-local-variable 'scroll-conservatively)
569 @xref{Scrolling, , Scrolling conservatively, emacs, The GNU Emacs
570 Manual}, for details.
572 @node Changing the time stamp format, Defining a new command, Scrolling conservatively, Hacking and Tweaking
573 @section Changing the time stamp format
576 @cindex format time stamp
577 @vindex rcirc-time-format
579 @code{rcirc-time-format} is the format used for the time stamp. Here's
580 how to include the date in the time stamp:
583 (setq rcirc-time-format "%Y-%m-%d %H:%M ")
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
592 Here's a simple new command, @code{/sv}. With it, you can boast about
593 your IRC client. It shows how you can use @code{defun-rcirc-command} to
596 We're waiting for the definition of this command until @code{rcirc} is loaded
597 because @code{defun-rcirc-command} is not yet available, and without
598 @code{rcirc} loaded, the command wouldn't do us much good anyway.
601 (eval-after-load 'rcirc
602 '(defun-rcirc-command sv (arg)
605 (rcirc-send-message process target
606 (concat "I use " rcirc-id-string))))
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
612 @cindex disconnecting servers, reconnecting
614 If you're chatting from a laptop, then you might be familiar with this
615 problem: When your laptop falls asleep and wakes up later, your IRC
616 client doesn't realise that it has been disconnected. It takes several
617 minutes until the client decides that the connection has in fact been
618 lost. The simple solution is to use @kbd{M-x rcirc}. The problem is
619 that this opens an @emph{additional} connection, so you'll have two
620 copies of every channel buffer --- one dead and one live.
622 The real answer, therefore, is a @code{/reconnect} command:
625 (eval-after-load 'rcirc
626 '(defun-rcirc-command reconnect (arg)
627 "Reconnect the server 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
645 (dolist (buf query-buffers)
646 (with-current-buffer buf
647 (setq rcirc-process new-process)))))))
650 @node Key Index, Variable Index, Hacking and Tweaking, Top
651 @unnumbered Key Index
654 @node Variable Index, Index, Key Index, Top
655 @unnumbered Variable Index
658 @node Index, , Variable Index, Top
665 arch-tag: 2589e562-3843-4ffc-8c2f-477cbad57c01