3 @setfilename ../info/rcirc
8 Copyright @copyright{} 2006, 2007 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 (@code{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 to
140 a question, it is customary to prefix the message with the nick followed
141 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 using the defaults.
159 @xref{Configuration}, if you want to change the defaults.
161 Use @kbd{C-u M-x irc} if you don't want to use the defaults, eg. if you
162 want to connect to a different network, or connect to the same network
163 using a different nick. This will prompt you for four things:
166 @cindex server, connecting
167 @cindex Freenode network
169 What server do you want to connect to? All the servers in a particular
170 network are equivalent. Some networks use a round-robin system where a
171 single server redirects new connections to a random server in the
172 network. @code{irc.freenode.net} is such a server for the Freenode
173 network. Freenode provides the network ``for the Free and Open Source
174 Software communities, for not-for-profit organisations and for related
175 communities and organizations.''
177 @cindex port, connecting
178 @cindex 6667, default IRC port
180 All network connections require a port. Just as web servers and clients
181 use port 80 per default, IRC uses port 6667 per default. You rarely
182 have to use a different port.
184 @cindex nick, connecting
185 @cindex changing nick
188 @vindex user-login-name
189 Every users needs a handle on-line. You will automatically be assigned
190 a slightly different nick if your chosen nick is already in use. If
191 your @code{user-login-name} is @code{alex}, and this nick is already
192 in use, you might for example get assigned the nick @code{alex`}.
194 @cindex channels, connecting
195 @cindex initial channels
196 @cindex startup channels
198 A space separated list of channels you want to join when connecting.
199 You don't need to join any channels, if you just want to have one-to-one
200 conversations with friends on the same network. If you're new to the
201 Freenode network, join @code{#emacs}, the channel about all things
202 Emacs, or join @code{#rcirc}, the channel about @code{rcirc}.
205 @cindex server buffer
206 When you have answered these questions, @code{rcirc} will create a server
207 buffer, which will be named something like @code{*irc.freenode.net*},
208 and a channel buffer for each of the channels you wanted to join.
212 @cindex communicating
213 To talk in a channel, just type in what you want to say in a channel
214 buffer, and press @key{RET}.
217 @cindex multiline messages
218 @cindex messages, multiple lines
219 @cindex pasting multiple lines
220 @cindex edit message before sending
221 If you want to paste multiple lines, such as source code, you can use
222 @kbd{C-c C-c} to edit your message in a separate buffer. Use @kbd{C-c
223 C-c} to finish editing. You still need to press @key{RET} to send it,
224 though. Generally, IRC users don't like people pasting more than around
225 four lines of code, so use with care.
227 @node Reference, Hacking and Tweaking, Basics, Top
231 This is the reference section of the manual. It is not complete. For
232 complete listings of @code{rcirc} features, use Emacs built-in
237 * Useful IRC commands::
241 @node rcirc commands, Useful IRC commands, Reference, Reference
242 @section rcirc commands
243 @cindex rcirc commands
247 This is a list of commands that you may use in @code{rcirc}. It is not
248 complete. For a complete listing, press @kbd{C-h m} in an @code{rcirc}
251 In addition to using regular Emacs key bindings, you can call them by
252 typing them into an @code{rcirc} buffer.
254 @cindex call commands
255 @cindex typing commands
257 For instance, instead of using the command @kbd{C-c C-j} to join a new
258 channel, you may type this in an @code{rcirc} buffer, and press @key{RET}:
264 @cindex / starts a command
265 @cindex messages starting with a slash disappear
266 @cindex disappearing messages if starting with a slash
267 @cindex slash hides message
268 This is why you cannot start a message with a slash. You will have to
269 precede the command with a space, or rewrite your message in order to
270 send it to a channel.
272 @cindex multiple words as parameters
273 @cindex string delimiters
275 @cindex double-quotes
276 Many commands take parameters. IRC commands usually ignore string
277 delimiters. Neither quote nor double-quote have special meanings in
281 /nick "alex schroeder"
284 This will try to change your nick to @code{"alex}. Usually this will
285 fail because the double quote character is not a legal character for
288 @cindex case insensitive commands
289 These commands are case insensitive.
292 @cindex unknown command
293 @cindex command unknown
294 If a command isn't known by @code{rcirc}, it will simply be sent along to the
295 server. There is a list of some useful commands like that in the next
302 @cindex join channels
303 @cindex other channels
304 @cindex rooms, joining
305 @cindex discussion, joining
306 This joins a channel such as @code{#rcirc} or @code{#emacs}. On most
307 networks, anybody can create new channels. If you want to talk with
308 some friends, for example, all you have to do is agree on a valid
309 channel name and join that channel. (Also @code{/join #emacs}.)
314 @cindex part a channel
315 @cindex leave a channel
316 @cindex disconnect from a channel
317 @cindex stop talking on a channel
318 @cindex kill channel buffer
319 This leaves the current channel. You can optionally provide a reason
320 for parting. When you kill a channel buffer, you automatically part the
321 corresponding channel. (Also @code{/part you are too weird!}.)
327 @cindex nick changing
328 @cindex rename yourself
330 This changes your nick to some other name. Your nick must be unique
331 across the network. Most networks don't allow too many nick changes in
332 quick succession, and have restrictions on the valid characters in nick
333 names. (Also @code{/nick alex-test})
338 @cindex who are these people
339 @cindex identifying people
340 @cindex channels other people are on
341 @cindex what channels people are on
342 Gives you some basic information about a nick. This often includes what
343 other channels people are on. (Also @code{/whois fsbot}.)
348 @cindex starting a private conversation
349 @cindex one-to-one conversation
350 @cindex talk privately
351 @cindex private conversation
352 @cindex contact one person only
353 @cindex query a person
354 Starts a one-to-one conversation with another person on the same
355 network. A new buffer will be created for this conversation. It works
356 like a channel with only two members. (Also @code{/query fsbot}.)
361 @cindex single message
362 @cindex message sending
363 This sends a single message to a nick. Like with @kbd{C-c C-q}, a new
364 buffer is created, where the response from the other party will show
365 up. (Also @code{/msg nickserv identify secret}.)
372 @cindex kill connection
373 @cindex connection end
374 @cindex part all channels
375 @cindex end connection
376 @cindex server buffer killing
377 @cindex reason for quitting
378 This disconnects from the server and parts all channels. You can
379 optionally provide a reason for quitting. When you kill the server
380 buffer, you automatically quit the server and part all channels. (Also
381 @code{/quit ZZZzzz...}.)
384 Some commands may not have a key binding, but only be available as typed
390 @cindex ignoring other people
391 @cindex trolls, ignoring
392 @cindex hide some posts
393 @cindex idiots online
394 This command toggles the ignore status of a nick, if you provide one.
395 If you don't provide a nick, the command lists all the nicks you are
396 ignoring. All messages by ignored nicks are---you guessed it---ignored.
397 Since only ``operators'' can kick people from channels, the
398 ignore command is often the only way to deal with some of the more
399 obnoxious fellows online. Example: @code{/ignore xah}.
402 @node Useful IRC commands, Configuration, rcirc commands, Reference
403 @section Useful IRC commands
407 As mentioned, if a command isn't known by @code{rcirc}, it will simply be sent
408 along to the server. Some such commands are available on nearly all IRC
416 @cindex unavailable status
417 @cindex set away status
418 This sets your status as ``being away'' if you provide a reason, or sets
419 your status as ``being back'' if you do not. People can use the
420 @kbd{C-c C-w} command to check your status. Example: @code{/away food}.
423 @cindex irc resources
424 @cindex help about irc
425 Typical IRC servers implement many more commands. You can read more
426 about the fantastic world of IRC online at
427 @uref{http://www.irchelp.org/, the Internet Relay Chat (IRC) help
430 @node Configuration, , Useful IRC commands, Reference
431 @section Configuration
432 @cindex configuring rcirc
434 These are some variables you can change to configure @code{rcirc} to your
438 @item rcirc-default-server
439 @vindex rcirc-default-server
440 the default server to connect to.
442 @item rcirc-default-port
443 @vindex rcirc-default-port
444 the default port to connect to.
446 @item rcirc-default-nick
447 @vindex rcirc-default-nick
448 the default nick to use.
452 (setq rcirc-default-server "irc.mozilla.org"
453 rcirc-default-port 6666
454 rcirc-default-nick "alx")
457 @vindex rcirc-default-user-full-name
461 @code{rcirc-default-user-full-name} is used to set your ``real name'' on
462 IRC. It defaults to @code{user-full-name}. If you want to hide your
463 full name, you might want to set it to some pseudonym.
466 (setq rcirc-default-user-full-name "Curious Minds Want To Know")
469 @vindex rcirc-startup-channels-alist
470 @cindex channels, configuration
471 @cindex initial channels, configuration
472 @cindex startup channels, configuration
473 @code{rcirc-startup-channels-alist} is the alist of channels to join
474 when connecting to a particular network. An alist is a list of lists.
475 Each sublist starts with a regular expression that is compared to the
476 server address you're connecting to. The remaining sublist items are
477 the channels to join.
480 (setq rcirc-startup-channels-alist
481 '(("\\.freenode\\.net$" "#emacs" "#rcirc" "#wiki")))
484 Note the subtle problem, here --- IRC clients connect to servers, and
485 there is no way of knowing which servers belong to a particular network.
486 In the example above we're exploiting a naming convention used by within
487 the Freenode network --- all servers within the network have a host in
488 the @code{freenode.net} domain.
490 @vindex rcirc-authinfo
491 @cindex authentification
492 @cindex identification
495 @code{rcirc-authinfo} is an alist used to automatically identify
496 yourself on networks. Each sublist starts with a regular expression
497 that is compared to the server address you're connecting to. The second
498 element in the list is a symbol representing the method to use, followed
499 by the arguments this method requires.
501 Here is an example to illustrate how you would set it:
505 '(("freenode" nickserv "bob" "p455w0rd")
506 ("freenode" chanserv "bob" "#bobland" "passwd99")
507 ("bitlbee" bitlbee "robert" "sekrit")))
510 And here are the valid method symbols and the arguments they require:
514 @cindex nickserv authentification
515 Use this symbol if you need to identify yourself as follows when
516 connecting to a network: @code{/msg nickserv identify secret}. The
517 necessary arguments are the nickname you want to use this for, and the
520 Before you can use this method, you will have to register your nick and
521 pick a password for it. Contact @code{nickserv} and check out the
522 details. (Using @code{/msg nickserv help}, for example.)
525 @cindex chanserv authentification
526 Use this symbol if you need to identify yourself as follows if you want
527 to join a particular channel: @code{/msg chanserv identify #underground
528 secret}. The necessary arguments are the nickname and channel you want
529 to use this for, and the password to use.
531 Before you can use this method, a channel contact must tell you about
532 the password to use. Contact @code{chanserv} and check out the details.
533 (Using @code{/msg chanserv help}, for example.)
536 @cindex bitlbee authentification
537 Use this symbol if you need to identify yourself in the Bitlbee channel
538 as follows: @code{identify secret}. The necessary arguments are the
539 nickname you want to use this for, and the password to use.
541 @cindex gateway to other IM services
542 @cindex instant messaging, other services
548 Bitlbee acts like an IRC server, but in fact it is a gateway to a lot of
549 other instant messaging services. You can either install Bitlbee
550 locally or use a public Bitlbee server. There, you need to create an
551 account with a password. This is the nick and password you need to
552 provide for the bitlbee authentification method.
554 Later, you will tell Bitlbee about your accounts and passwords on all
555 the other instant messaging services, and Bitlbee will log you in. All
556 @code{rcirc} needs to know, is the login to your Bitlbee account. Don't
557 confuse the Bitlbee account with all the other accounts.
561 @vindex rcirc-track-minor-mode
562 @cindex switching channels
563 @cindex tracking activity
564 @cindex active channel
565 @cindex abbreviated channel names
566 @cindex modeline tracks activity
567 Most people want a notification when something is said on a channel they
568 have joined, particularly if they have been addressed directly. There
569 is a global minor mode that will do this kind of tracking for you. All
570 you need to do is switch it on using @kbd{M-x rcirc-track-minor-mode}.
571 To make this permanent, add the following to your init file:
574 (rcirc-track-minor-mode 1)
577 When other people say things in buffers that are currently buried (no
578 window is showing them), the mode line will now show you the abbreviated
579 channel or nick name. Use @kbd{C-c C-@key{SPC}} to switch to these
582 @vindex rcirc-mode-hook
583 If you prefer not to load @code{rcirc} immediately, you can delay the
584 activation of this mode:
587 (add-hook 'rcirc-mode-hook
589 (rcirc-track-minor-mode 1)))
592 @node Hacking and Tweaking, Key Index, Reference, Top
593 @chapter Hacking and Tweaking
594 @cindex hacking and tweaking
596 Here are some examples of stuff you can do to configure @code{rcirc}.
599 * Skipping /away messages using handlers::
600 * Using fly spell mode::
601 * Scrolling conservatively::
602 * Changing the time stamp format::
603 * Defining a new command::
604 * Reconnecting after you have lost the connection::
607 @node Skipping /away messages using handlers, Using fly spell mode, Hacking and Tweaking, Hacking and Tweaking
608 @section Skipping @code{/away} messages using handlers
609 @cindex /away messages
613 The IRC protocol specifies how certain events are signaled from server
614 to client. These events have numbers and are dealt with using so-called
615 handlers. You can override existing handlers by exploiting the naming
616 convention adopted for @code{rcirc}.
618 Here's how to stop @code{rcirc} from printing @code{/away} messages.
619 Since @code{rcirc} doesn't define a 301 handler, you don't need to
620 require @code{rcirc} before defining the handler:
623 (defun rcirc-handler-301 (process cmd sender args)
624 "/away message handler.")
627 @node Using fly spell mode, Scrolling conservatively, Skipping /away messages using handlers, Hacking and Tweaking
628 @section Using fly spell mode
631 @cindex spell-checking as you type
632 @cindex automatic spelling
633 @vindex rcirc-mode-hook
635 The following code activates Fly Spell Mode
636 for @code{rcirc} buffers:
639 (add-hook 'rcirc-mode-hook (lambda ()
643 @xref{Spelling, , Flyspell mode, emacs, The GNU Emacs Manual},
646 @node Scrolling conservatively, Changing the time stamp format, Using fly spell mode, Hacking and Tweaking
647 @section Scrolling conservatively
650 @vindex scroll-conservatively
651 @vindex rcirc-mode-hook
653 IRC buffers are constantly growing. If you want to see as much as
654 possible at all times, you would want the prompt at the bottom of the
655 window when possible. The following snippet uses a local value for
656 @code{scroll-conservatively} to achieve this:
659 (add-hook 'rcirc-mode-hook
661 (set (make-local-variable 'scroll-conservatively)
665 @xref{Scrolling, , Scrolling conservatively, emacs, The GNU Emacs
666 Manual}, for details.
668 @node Changing the time stamp format, Defining a new command, Scrolling conservatively, Hacking and Tweaking
669 @section Changing the time stamp format
672 @cindex format time stamp
673 @vindex rcirc-time-format
675 @code{rcirc-time-format} is the format used for the time stamp. Here's
676 how to include the date in the time stamp:
679 (setq rcirc-time-format "%Y-%m-%d %H:%M ")
682 @node Defining a new command, Reconnecting after you have lost the connection, Changing the time stamp format, Hacking and Tweaking
683 @section Defining a new command
684 @cindex defining commands
685 @cindex commands, defining
686 @cindex new commands, defining
688 Here's a simple new command, @code{/sv}. With it, you can boast about
689 your IRC client. It shows how you can use @code{defun-rcirc-command} to
692 We're waiting for the definition of this command until @code{rcirc} is loaded
693 because @code{defun-rcirc-command} is not yet available, and without
694 @code{rcirc} loaded, the command wouldn't do us much good anyway.
697 (eval-after-load 'rcirc
698 '(defun-rcirc-command sv (arg)
701 (rcirc-send-message process target
702 (concat "I use " rcirc-id-string))))
705 @node Reconnecting after you have lost the connection, , Defining a new command, Hacking and Tweaking
706 @section Reconnecting after you have lost the connection
708 @cindex disconnecting servers, reconnecting
710 If you're chatting from a laptop, then you might be familiar with this
711 problem: When your laptop falls asleep and wakes up later, your IRC
712 client doesn't realise that it has been disconnected. It takes several
713 minutes until the client decides that the connection has in fact been
714 lost. The simple solution is to use @kbd{M-x rcirc}. The problem is
715 that this opens an @emph{additional} connection, so you'll have two
716 copies of every channel buffer --- one dead and one live.
718 The real answer, therefore, is a @code{/reconnect} command:
721 (eval-after-load 'rcirc
722 '(defun-rcirc-command reconnect (arg)
723 "Reconnect the server process."
726 (error "There's no process for this target"))
727 (let* ((server (car (process-contact process)))
728 (port (process-contact process :service))
729 (nick (rcirc-nick process))
730 channels query-buffers)
731 (dolist (buf (buffer-list))
732 (with-current-buffer buf
733 (when (eq process (rcirc-buffer-process))
734 (remove-hook 'change-major-mode-hook
735 'rcirc-change-major-mode-hook)
736 (if (rcirc-channel-p rcirc-target)
737 (setq channels (cons rcirc-target channels))
738 (setq query-buffers (cons buf query-buffers))))))
739 (delete-process process)
740 (rcirc-connect server port nick
741 rcirc-default-user-name
742 rcirc-default-user-full-name
746 @node Key Index, Variable Index, Hacking and Tweaking, Top
747 @unnumbered Key Index
750 @node Variable Index, Index, Key Index, Top
751 @unnumbered Variable Index
754 @node Index, , Variable Index, Top
761 arch-tag: 2589e562-3843-4ffc-8c2f-477cbad57c01