3 @setfilename ../../info/rcirc
8 Copyright @copyright{} 2006--2013 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.3 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''.
18 (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
19 modify this GNU manual.''
23 @dircategory Emacs network features
25 * Rcirc: (rcirc). Internet Relay Chat (IRC) client.
31 @vskip 0pt plus 1filll
41 @code{rcirc} is an Emacs IRC client.
43 IRC (Internet Relay Chat) is a multi-user chat protocol. Users
44 communicate with each other in real-time. Communication occurs both in
45 topic channels which are collections of many users, or privately, with
55 * Fighting Information Overload::
56 * Hacking and Tweaking::
57 * GNU Free Documentation License::
63 --- The Detailed Node Listing ---
67 * Internet Relay Chat::
68 * Getting started with rcirc::
73 * Useful IRC commands::
76 Fighting Information Overload
85 * Skipping /away messages using handlers::
86 * Using fly spell mode::
87 * Scrolling conservatively::
88 * Changing the time stamp format::
89 * Defining a new command::
90 * Reconnecting after you have lost the connection::
98 This chapter contains a brief introduction to IRC (Internet Relay Chat),
99 and a quick tutorial on @code{rcirc}.
102 * Internet Relay Chat::
103 * Getting started with rcirc::
106 @node Internet Relay Chat
107 @section Internet Relay Chat
108 @cindex internet relay chat
112 @dfn{Internet Relay Chat} (IRC) is a form of instant communication over the
113 Internet. It is mainly designed for group (many-to-many) communication
114 in discussion forums called channels, but also allows one-to-one
117 @cindex instant messaging, comparison
120 Contrary to most Instant Messenger (IM) systems, users usually don't
121 connect to a central server. Instead, users connect to a random
122 server in a network, and servers relay messages from one to the next.
124 Here's a typical example:
126 @cindex redirection to random servers
127 When you connect to the Freenode network
128 (@code{http://freenode.net/}), you point your IRC client at the
129 server @code{irc.freenode.net}. That server will redirect your client
130 to a random server on the network, such as @code{zelazny.freenode.net}.
133 @cindex # starts a channel name
134 Once you're connected, you can send messages to all other users
135 connected to the same network, and you can join all channels on the same
136 network. You might join the @code{#emacs} and the @code{#rcirc}
137 channels, for example. (Typically, channel names begin with a hash
140 Once you have joined a channel, anything you type will be broadcast to
141 all the other users on the same channel.
143 @cindex addressing other people
144 @cindex other people, addressing them
145 @cindex talk to other people
146 If you want to address someone specifically, for example as an answer to
147 a question, it is customary to prefix the message with the nick followed
148 by a colon, like this:
154 @cindex nick completion
155 @cindex completion of nicks
157 Since this is so common, you can use @key{TAB} to do nick completion.
159 @node Getting started with rcirc
160 @section Getting started with rcirc
161 @cindex getting started
162 @cindex connecting to a server
165 Use the command @kbd{M-x irc} to connect using the defaults.
166 @xref{Configuration}, if you want to change the defaults.
168 Use @kbd{C-u M-x irc} if you don't want to use the defaults, e.g., if you
169 want to connect to a different network, or connect to the same network
170 using a different nick. This will prompt you for four things:
173 @cindex server, connecting
174 @cindex Freenode network
176 What server do you want to connect to? All the servers in a particular
177 network are equivalent. Some networks use a round-robin system where a
178 single server redirects new connections to a random server in the
179 network. @code{irc.freenode.net} is such a server for the Freenode
180 network. Freenode provides the network ``for the Free and Open Source
181 Software communities, for not-for-profit organizations and for related
182 communities and organizations.''
184 @cindex port, connecting
185 @cindex 6667, default IRC port
187 All network connections require a port. Just as web servers and clients
188 use port 80 per default, IRC uses port 6667 per default. You rarely
189 have to use a different port.
191 @cindex nick, connecting
192 @cindex changing nick
195 @vindex user-login-name
196 Every users needs a handle on-line. You will automatically be assigned
197 a slightly different nick if your chosen nick is already in use. If
198 your @code{user-login-name} is @code{alex}, and this nick is already
199 in use, you might for example get assigned the nick @code{alex`}.
201 @cindex channels, connecting
202 @cindex initial channels
203 @cindex startup channels
205 A space separated list of channels you want to join when connecting.
206 You don't need to join any channels, if you just want to have one-to-one
207 conversations with friends on the same network. If you're new to the
208 Freenode network, join @code{#emacs}, the channel about all things
209 Emacs, or join @code{#rcirc}, the channel about @code{rcirc}.
212 @cindex server buffer
213 When you have answered these questions, @code{rcirc} will create a server
214 buffer, which will be named something like @code{*irc.freenode.net*},
215 and a channel buffer for each of the channels you wanted to join.
219 @cindex communicating
220 To talk in a channel, just type what you want to say in a channel
221 buffer, and press @key{RET}.
224 @cindex multiline messages
225 @cindex messages, multiple lines
226 @cindex pasting multiple lines
227 @cindex edit message before sending
228 If you want to paste multiple lines, such as source code, you can use
229 @kbd{C-c C-c} to edit your message in a separate buffer. Use @kbd{C-c
230 C-c} to finish editing. You still need to press @key{RET} to send it,
231 though. Generally, IRC users don't like people pasting more than around
232 four lines of code, so use with care.
234 @comment This section copied from the Channels section.
235 @comment All index markers should point to the original!
236 Once you are connected to multiple channels, or once you've turned you
237 attention to other buffers in Emacs, you probably want to be notified
238 of any activity in channels not currently visible. All you need to do
239 is switch channel tracking on using @kbd{M-x rcirc-track-minor-mode}.
240 To make this permanent, add the following to your init file:
243 (rcirc-track-minor-mode 1)
246 Use @kbd{C-c C-@key{SPC}} to switch to these buffers.
252 This is the reference section of the manual. It is not complete. For
253 complete listings of @code{rcirc} features, use Emacs built-in
258 * Useful IRC commands::
263 @section rcirc commands
264 @cindex rcirc commands
268 This is a list of commands that you may use in @code{rcirc}. It is not
269 complete. For a complete listing, press @kbd{C-h m} in an @code{rcirc}
272 In addition to using regular Emacs key bindings, you can call them by
273 typing them into an @code{rcirc} buffer.
275 @cindex call commands
276 @cindex typing commands
278 For instance, instead of using the command @kbd{C-c C-j} to join a new
279 channel, you may type this in an @code{rcirc} buffer, and press @key{RET}:
285 @cindex / starts a command
286 @cindex messages starting with a slash disappear
287 @cindex disappearing messages if starting with a slash
288 @cindex slash hides message
289 This is why you cannot start a message with a slash. You will have to
290 precede the command with a space, or rewrite your message in order to
291 send it to a channel.
293 @cindex multiple words as parameters
294 @cindex string delimiters
296 @cindex double-quotes
297 Many commands take parameters. IRC commands usually ignore string
298 delimiters. Neither quote nor double-quote have special meanings in
302 /nick "alex schroeder"
305 This will try to change your nick to @code{"alex}. Usually this will
306 fail because the double quote character is not a valid character for
309 @cindex case insensitive commands
310 These commands are case insensitive.
313 @cindex unknown command
314 @cindex command unknown
315 If a command isn't known by @code{rcirc}, it will simply be sent along to the
316 server. There is a list of some useful commands like that in the next
323 @cindex join channels
324 @cindex other channels
325 @cindex rooms, joining
326 @cindex discussion, joining
327 This joins a channel such as @code{#rcirc} or @code{#emacs}. On most
328 networks, anybody can create new channels. If you want to talk with
329 some friends, for example, all you have to do is agree on a valid
330 channel name and join that channel. (Also @code{/join #emacs}.)
335 @cindex part a channel
336 @cindex leave a channel
337 @cindex disconnect from a channel
338 @cindex stop talking on a channel
339 @cindex kill channel buffer
340 This leaves the current channel. You can optionally provide a reason
341 for parting. When you kill a channel buffer, you automatically part the
342 corresponding channel. (Also @code{/part you are too weird!}.)
348 @cindex nick changing
349 @cindex rename yourself
351 This changes your nick to some other name. Your nick must be unique
352 across the network. Most networks don't allow too many nick changes in
353 quick succession, and have restrictions on the valid characters in nick
354 names. (Also @code{/nick alex-test})
359 @cindex who are these people
360 @cindex identifying people
361 @cindex channels other people are on
362 @cindex what channels people are on
363 Gives you some basic information about a nick. This often includes what
364 other channels people are on. (Also @code{/whois fsbot}.)
369 @cindex starting a private conversation
370 @cindex one-to-one conversation
371 @cindex talk privately
372 @cindex private conversation
373 @cindex contact one person only
374 @cindex query a person
375 Starts a one-to-one conversation with another person on the same
376 network. A new buffer will be created for this conversation. It works
377 like a channel with only two members. (Also @code{/query fsbot}.)
382 @cindex single message
383 @cindex message sending
384 This sends a single message to a nick. Like with @kbd{C-c C-q}, a new
385 buffer is created, where the response from the other party will show
386 up. (Also @code{/msg nickserv identify secret}.)
393 @cindex kill connection
394 @cindex connection end
395 @cindex part all channels
396 @cindex end connection
397 @cindex server buffer killing
398 @cindex reason for quitting
399 This disconnects from the server and parts all channels. You can
400 optionally provide a reason for quitting. When you kill the server
401 buffer, you automatically quit the server and part all channels. (Also
402 @code{/quit ZZZzzz...}.)
405 @node Useful IRC commands
406 @section Useful IRC commands
410 As mentioned, if a command isn't known by @code{rcirc}, it will simply be sent
411 along to the server. Some such commands are available on nearly all IRC
419 @cindex unavailable status
420 @cindex set away status
421 This sets your status as ``being away'' if you provide a reason, or sets
422 your status as ``being back'' if you do not. People can use the
423 @kbd{C-c C-w} command to check your status. Example: @code{/away food}.
426 @cindex irc resources
427 @cindex help about irc
428 Typical IRC servers implement many more commands. You can read more
429 about the fantastic world of IRC online at
430 @uref{http://www.irchelp.org/, the Internet Relay Chat (IRC) help
434 @section Configuration
435 @cindex configuring rcirc
437 These are some variables you can change to configure @code{rcirc} to your
441 @item rcirc-server-alist
442 @vindex rcirc-server-alist
443 @cindex channels, configuration
444 @cindex initial channels, configuration
445 @cindex startup channels, configuration
446 @cindex servers, configuration
447 @cindex initial servers, configuration
448 @cindex startup servers, configuration
449 This variable contains an alist of servers to connect to by default
450 and the keywords parameters to use. The keyword parameters are
451 optional. If you don't provide any, the defaults as documented below
454 The most important parameter is the @code{:channels} parameter. It
455 controls which channels you will join by default as soon as you are
456 connected to the server.
458 Here's an example of how to set it:
461 (add-to-list 'rcirc-server-alist
462 '("otherworlders.org"
463 :channels ("#FUDGE" "#game-design")))
466 By default you will be connected to the @code{rcirc} support channel:
467 @code{#rcirc} on @code{irc.freenode.net}.
471 This overrides @code{rcirc-default-nick}.
474 This overrides @code{rcirc-default-port}.
477 This overrides @code{rcirc-default-user-name}.
480 This overrides @code{rcirc-default-full-name}.
483 This describes which channels to join when connecting to the server.
484 If absent, no channels will be connected to automatically.
488 @item rcirc-default-nick
489 @vindex rcirc-default-nick
490 This variable is used for the default nick. It defaults to the login
491 name returned by @code{user-login-name}.
494 (setq rcirc-default-nick "kensanata")
497 @item rcirc-default-port
498 @vindex rcirc-default-port
500 This variable contains the default port to connect to. It is 6667 by
501 default and rarely needs changing.
503 @item rcirc-default-user-name
504 @vindex rcirc-default-user-name
506 This variable contains the default user name to report to the server.
507 It defaults to the login name returned by @code{user-login-name}, just
508 like @code{rcirc-default-nick}.
510 @item rcirc-default-full-name
511 @vindex rcirc-default-full-name
515 This variable is used to set your ``real name'' on IRC@. It defaults
516 to the name returned by @code{user-full-name}. If you want to hide
517 your full name, you might want to set it to some pseudonym.
520 (setq rcirc-default-full-name "Curious Minds Want To Know")
524 @vindex rcirc-authinfo
525 @cindex authentication
526 @cindex identification
529 This variable is an alist used to automatically identify yourself on
530 networks. Each sublist starts with a regular expression that is
531 compared to the server address you're connecting to. The second
532 element in the list is a symbol representing the method to use,
533 followed by the arguments this method requires.
535 Here is an example to illustrate how you would set it:
539 '(("freenode" nickserv "bob" "p455w0rd")
540 ("freenode" chanserv "bob" "#bobland" "passwd99")
541 ("bitlbee" bitlbee "robert" "sekrit")))
544 And here are the valid method symbols and the arguments they require:
548 @cindex nickserv authentication
549 Use this symbol if you need to identify yourself as follows when
550 connecting to a network: @code{/msg nickserv identify secret}. The
551 necessary arguments are the nickname you want to use this for, and the
554 Before you can use this method, you will have to register your nick and
555 pick a password for it. Contact @code{nickserv} and check out the
556 details. (Using @code{/msg nickserv help}, for example.)
559 @cindex chanserv authentication
560 Use this symbol if you need to identify yourself as follows if you want
561 to join a particular channel: @code{/msg chanserv identify #underground
562 secret}. The necessary arguments are the nickname and channel you want
563 to use this for, and the password to use.
565 Before you can use this method, a channel contact must tell you about
566 the password to use. Contact @code{chanserv} and check out the details.
567 (Using @code{/msg chanserv help}, for example.)
570 @cindex bitlbee authentication
571 Use this symbol if you need to identify yourself in the Bitlbee channel
572 as follows: @code{identify secret}. The necessary arguments are the
573 nickname you want to use this for, and the password to use.
575 @cindex gateway to other IM services
576 @cindex instant messaging, other services
582 Bitlbee acts like an IRC server, but in fact it is a gateway to a lot of
583 other instant messaging services. You can either install Bitlbee
584 locally or use a public Bitlbee server. There, you need to create an
585 account with a password. This is the nick and password you need to
586 provide for the bitlbee authentication method.
588 Later, you will tell Bitlbee about your accounts and passwords on all
589 the other instant messaging services, and Bitlbee will log you in. All
590 @code{rcirc} needs to know, is the login to your Bitlbee account. Don't
591 confuse the Bitlbee account with all the other accounts.
597 @node Fighting Information Overload
598 @chapter Fighting Information Overload
599 @cindex information overload
601 This is the section of the manual that caters to the busy person
602 online. There are support channels with several hundred people in
603 them. Trying to follow a conversation in these channels can be a
604 daunting task. This chapters tells you how @code{rcirc} can help.
618 @comment This section copied to the Getting started with rcirc section
620 @vindex rcirc-track-minor-mode
621 @cindex switching channels
622 @cindex tracking activity
623 @cindex active channel
624 @cindex abbreviated channel names
625 @cindex modeline tracks activity
626 Most people want a notification when something is said on a channel they
627 have joined, particularly if they have been addressed directly. There
628 is a global minor mode that will do this kind of tracking for you. All
629 you need to do is switch it on using @kbd{M-x rcirc-track-minor-mode}.
630 To make this permanent, add the following to your init file:
633 (rcirc-track-minor-mode 1)
636 When other people say things in buffers that are currently buried (no
637 window is showing them), the mode line will now show you the abbreviated
638 channel or nick name. Use @kbd{C-c C-@key{SPC}} to switch to these
641 @vindex rcirc-mode-hook
642 If you prefer not to load @code{rcirc} immediately, you can delay the
643 activation of this mode:
646 (add-hook 'rcirc-mode-hook
648 (rcirc-track-minor-mode 1)))
651 @cindex busy channels
652 If you've joined a very active support channel, tracking activity is
653 no longer useful. The channel will be always active. Switching to
654 active channels using @kbd{C-c C-@key{SPC}} no longer works as
658 @cindex low priority channels
659 The solution is to mark this channel as a low priority channel.
660 Use @kbd{C-c C-l} to make the current channel a low-priority channel.
661 Low priority channels have the modeline indicator ``LowPri''.
662 @kbd{C-c C-@key{SPC}} will not switch to low priority channels unless
663 you use the @kbd{C-u} prefix.
666 @cindex ignored channels
667 If you prefer a channel to never show up in the modeline, then you
668 have to ignore it. Use @kbd{C-c @key{TAB}} to ignore the current
673 @cindex people, how to ignore
674 @cindex nicks, how to ignore
679 The most important command available to the discerning IRC user is
680 @code{/ignore}. It's the big equalizer online: If people aggravate
681 you, just ignore them.
683 This is of course a crude all-or-nothing solution. Fear not,
684 @code{rcirc} offers alternatives: You can ``brighten'' your buddies
685 and ``dim'' certain other nicks that you don't want to ignore
691 @cindex ignoring other people
692 @cindex trolls, ignoring
693 @cindex hide some posts
694 @cindex idiots online
695 This command toggles the ignore status of a nick, if you provide one.
696 If you don't provide a nick, the command lists all the nicks you are
697 ignoring. All messages by ignored nicks are---you guessed it---ignored.
698 Since only ``operators'' can kick people from channels, the
699 ignore command is often the only way to deal with some of the more
700 obnoxious fellows online. Example: @code{/ignore rudybot}.
704 @cindex highlight other people
705 @cindex friends, highlight
706 @cindex buddies, highlight
707 @cindex nicks, highlight
708 @cindex brighten nicks
709 This command toggles the bright status of a nick, if you provide one.
710 If you don't provide a nick, the command lists all the ``brightened''
711 nicks. All messages by brightened nicks are---you guessed
712 it---brightened. Use this for your friends. Example: @code{/bright
717 @cindex soft-ignore other people
718 @cindex obnoxious people online
719 @cindex rabble online
720 This command toggles the dim status of a nick, if you provide one. If
721 you don't provide a nick, the command lists all the ``dimmed'' nicks.
722 All messages by dimmed nicks are---you guessed it---dimmed. Use this
723 for boring people and bots. If you are tracking channel activity,
724 messages by dimmed nicks will not register as activity. Example:
733 On a busy channel, you might want to ignore all activity (using
734 @kbd{C-c @key{TAB}}) and just watch for certain keywords. The
735 following command allows you to highlight certain keywords:
740 This command toggles the highlighting of a keyword, if you provide
741 one. If you don't provide a keyword, the current keywords are
742 listed. Example: @code{/keyword manual}.
747 @cindex part notices, how to omit
748 @cindex join notices, how to omit
749 @cindex quit notices, how to omit
750 @cindex nick notices, how to omit
753 @cindex low priority channels
754 In busy channels you might not be interested in all the joining,
755 parting, quitting, and renaming that goes on. You can omit those
756 notices using @kbd{C-c C-o}.
758 @vindex rcirc-omit-responses
759 @cindex away notices, how to omit
760 You can control which notices get omitted via the
761 @code{rcirc-omit-responses} variable. Here's an example of how to
765 (setq rcirc-omit-responses '("JOIN" "PART" "QUIT" "NICK" "AWAY"))
768 @vindex rcirc-omit-threshold
769 Notice that these messages will not be omitted if the nick in question
770 has recently been active. After all, you don't want to continue a
771 conversation with somebody who just left. That's why @code{rcirc}
772 checks recent lines in the buffer to figure out if a nick has been
773 active and only omits a message if the nick has not been active. The
774 window @code{rcirc} considers is controlled by the
775 @code{rcirc-omit-threshold} variable.
777 @node Hacking and Tweaking
778 @chapter Hacking and Tweaking
779 @cindex hacking and tweaking
781 Here are some examples of stuff you can do to configure @code{rcirc}.
784 * Skipping /away messages using handlers::
785 * Using fly spell mode::
786 * Scrolling conservatively::
787 * Changing the time stamp format::
788 * Defining a new command::
789 * Reconnecting after you have lost the connection::
792 @node Skipping /away messages using handlers
793 @section Skipping @code{/away} messages using handlers
794 @cindex /away messages
798 The IRC protocol specifies how certain events are signaled from server
799 to client. These events have numbers and are dealt with using so-called
800 handlers. You can override existing handlers by exploiting the naming
801 convention adopted for @code{rcirc}.
803 Here's how to stop @code{rcirc} from printing @code{/away} messages.
804 Since @code{rcirc} doesn't define a 301 handler, you don't need to
805 require @code{rcirc} before defining the handler:
808 (defun rcirc-handler-301 (process cmd sender args)
809 "/away message handler.")
812 @node Using fly spell mode
813 @section Using fly spell mode
816 @cindex spell-checking as you type
817 @cindex automatic spelling
818 @vindex rcirc-mode-hook
820 The following code activates Fly Spell Mode
821 for @code{rcirc} buffers:
824 (add-hook 'rcirc-mode-hook (lambda ()
828 @xref{Spelling, , Flyspell mode, emacs, The GNU Emacs Manual},
831 @node Scrolling conservatively
832 @section Scrolling conservatively
835 @vindex scroll-conservatively
836 @vindex rcirc-mode-hook
838 IRC buffers are constantly growing. If you want to see as much as
839 possible at all times, you would want the prompt at the bottom of the
840 window when possible. The following snippet uses a local value for
841 @code{scroll-conservatively} to achieve this:
844 (add-hook 'rcirc-mode-hook
846 (set (make-local-variable 'scroll-conservatively)
850 @xref{Scrolling, , Scrolling conservatively, emacs, The GNU Emacs
851 Manual}, for details.
853 @node Changing the time stamp format
854 @section Changing the time stamp format
857 @cindex format time stamp
858 @vindex rcirc-time-format
860 @code{rcirc-time-format} is the format used for the time stamp. Here's
861 how to include the date in the time stamp:
864 (setq rcirc-time-format "%Y-%m-%d %H:%M ")
867 @node Defining a new command
868 @section Defining a new command
869 @cindex defining commands
870 @cindex commands, defining
871 @cindex new commands, defining
873 Here's a simple new command, @code{/sv}. With it, you can boast about
874 your IRC client. It shows how you can use @code{defun-rcirc-command} to
877 We're waiting for the definition of this command until @code{rcirc} is loaded
878 because @code{defun-rcirc-command} is not yet available, and without
879 @code{rcirc} loaded, the command wouldn't do us much good anyway.
882 (eval-after-load 'rcirc
883 '(defun-rcirc-command sv (arg)
886 (rcirc-send-message process target
887 (concat "I use " rcirc-id-string))))
890 @node Reconnecting after you have lost the connection
891 @section Reconnecting after you have lost the connection
893 @cindex disconnecting servers, reconnecting
895 If you're chatting from a laptop, then you might be familiar with this
896 problem: When your laptop falls asleep and wakes up later, your IRC
897 client doesn't realize that it has been disconnected. It takes several
898 minutes until the client decides that the connection has in fact been
899 lost. The simple solution is to use @kbd{M-x rcirc}. The problem is
900 that this opens an @emph{additional} connection, so you'll have two
901 copies of every channel buffer, one dead and one live.
903 The real answer, therefore, is a @code{/reconnect} command:
906 (eval-after-load 'rcirc
907 '(defun-rcirc-command reconnect (arg)
908 "Reconnect the server process."
911 (error "There's no process for this target"))
912 (let* ((server (car (process-contact process)))
913 (port (process-contact process :service))
914 (nick (rcirc-nick process))
915 channels query-buffers)
916 (dolist (buf (buffer-list))
917 (with-current-buffer buf
918 (when (eq process (rcirc-buffer-process))
919 (remove-hook 'change-major-mode-hook
920 'rcirc-change-major-mode-hook)
921 (if (rcirc-channel-p rcirc-target)
922 (setq channels (cons rcirc-target channels))
923 (setq query-buffers (cons buf query-buffers))))))
924 (delete-process process)
925 (rcirc-connect server port nick
926 rcirc-default-user-name
927 rcirc-default-full-name
931 @node GNU Free Documentation License
932 @appendix GNU Free Documentation License
933 @include doclicense.texi
937 @unnumbered Key Index
941 @unnumbered Variable Index