rcirc is a next generation InternetRelayChat client. It blends seamlessly with the rest of Emacs, it’s tight, fast, and doesn’t light up like a christmas tree. rcirc also has sane defaults. There is little or no reason to customize it because it does what you want by default (except that many people still do).

rcirc is part of GNU Emacs since release 22.0.

Talking about rcirc

If you want to chat about rcirc, the place is #rcirc on freenode.

Getting rcirc

If you are running Emacs 22, you already have it. Skip this section.

To check out rcirc.el from EmacsFromCVS: GIT:net/rcirc.el.

New versions of rcirc do not work in Emacs 21. You can get the last version of rcirc working in Emacs 21 here: Lisp:rcirc.el.

Starting rcirc

In Emacs 22, just type M-x irc.

In Emacs 21 and/or a very old rcirc version, you will have to add this to your InitFile:

(eval-after-load "rcirc"                ; for Emacs 21
  '(if (not (functionp 'irc))
       (defun irc (x)
         (interactive "P")
         (if x
             (call-interactively 'rcirc)
           (rcirc rcirc-server rcirc-port rcirc-nick
                  (rcirc-startup-channels rcirc-server))))))

then just do as usual.

rcirc comes set up with default values for IRC server and port (irc.freenode.net 6667), nickname (your login name), and channel (#rcirc). You can override these settings in your InitFile or use C-u M-x rcirc to set these values. You also can define a key to start it for you:

(global-set-key (kbd "C-c I") 'irc)

Please also consider visiting these pages in order to getting started:

examples of stuff you can do to configure rcirc.
How to get automatic authentication with nickserv &c.

Connecting to servers using SSL/TLS

Emacs 24 has SSL support out of the box but rcirc doesn’t use it by default. Here’s how to set it up:

(setq rcirc-server-alist
      '(("irc.freenode.net" :port 6697 :encryption tls
	 :channels ("#rcirc" "#emacs" "#emacswiki"))))

Use post 6697. This requires an Emacs that has been built with GNU TLS or an appropriate gnutls-cli.

If you are on Windows, you can download a precompiled binary. Make sure the bin directory is on your path. Test it by calling gnutls-cli from ‘eshell’. This is what you would expect:

Welcome to the Emacs shell

~ $ gnutls-cli
No hostname specified

For Emacs 23 you need a fork of rcirc:

https://github.com/nealey/rcirc/wiki which makes possible to use an arbitrary connection method (ssl/proxy/whatever)

or this (SSL with an optional :use-tls for ‘rcirc-server-alist’ and :custom-connect-function for arbitrary connection method (ssl/proxy/whatever) similar to the neale’s patch) https://github.com/melmothx/rcirc/tree/to-emacs


gnutls.c: [1] Note that the security level of the Diffie-Hellman key exchange has been lowered to 256 bits and this may allow decryption of the session data

If you’re getting this warning, add the following to your init file:

(setq gnutls-min-prime-bits 1024)

There’s an explanation on the mailing list.

rcirc add-ons and commands

/color – color each nick using a separate color
Alternative scheme where nicks can belong to classes such as pals or bots
Handle escape sequences that convey text colors
/retake – send RECOVER and RELEASE messages to NickServ
/reconnect – quit and reconnect immediately for users waking their laptop from sleep after the server has closed the connection
Automatically reconnect when disconnected from the IRC server
/pounce, /unpounce – store messages for people and send them when they join one of the channels you’re on
Add little 😊 and 😟 smileys
/all – run a command such as /away for all connections
How not to display NAMES list on channel JOIN (ugly hacks inside)
/sv – show rcirc version
Display how long you are/were away from IRC
Cancel your AWAY state with /back (requires rcircAwayTime)
Log conversations to disk
Patch that adds server authentication (PASS).
Go /away after Emacs is idle for a period of time.
Play sounds through IRC using CTCP SOUND.
Change the encoding per channel
Correct original word when ‘s/wrong/right’ messages are seen.
/help – list rcirc commands and show their documentation
Let TAB complete commands and nicks
Dim the entire line for nicks in ‘rcirc-dim-nicks’.
Libnotify notification popups when someone talks to you
How to make yourself invisible (+i); how to advice ‘rcirc-connect’
Have your rcirc windows dynamically set fill-column instead of always being too long or too short
propose an rcirc-groups buffer ala gnus Group, with refresh and catchup options (and RET to follow), in order to manage notifications in rcirc
how to automatically join a restricted channel
how to use Facebook chat
/occur – find stuff in all your rcirc buffers
/op, /deop, /mute, /unmute, /ban, /unban, /kickban
Minimal activity tracker, open for extension. Use rcirc-activities/switch-to-buffer to see and switch to buffers with activities, using ido.

Related stuff that might be of interest

rcirc for bs-show
A configuration for ‘M-x bs-show’ users
rcirc and iswitchb
Hiding IRC buffers from iswitchb
Beep when your nick is mentioned.
Beep when there is activity in a hidden channel.
osx browse-url-browser-function
A browser function for OSX.
Don’t cycle-complete nicks if there is ambiguity
Start your session by kicking the evil bastard that’s stealing your nick
Make rcirc tell something else about your presence status (I’m away!)
rcirc tracking with elscreen
when using elscreen the default “switch-to-buffer” function used by rcirc-track-minor-mode can be changed. To make rcirc switch to the screen where the buffer with the last activity is located simply add to your InitFile (setq rcirc-switch-to-buffer-function 'elscreen-find-and-goto-by-buffer). This has a problem though: automatic switching after some actions (joining a channel, for example) will stop working. One possible solution is:
(defun rcirc-switch-buffer-or-screen (buffer)
  (if (elscreen-find-screen-by-buffer buffer)
      (elscreen-find-and-goto-by-buffer buffer)
    (switch-to-buffer buffer)))
(setq rcirc-switch-to-buffer-function 'rcirc-switch-buffer-or-screen)
Make irc blink the Thinkpad light twice when someone talks to you.
use the dbus bindings for notifications
replace the text of /dim user’s speech with nonsense
Display all open channel buffers (or query buffers) at once
change all the nicks to random names
Replace “cloud” with “butt” and other idiocy

rcirc can highlight the channels in the mode line only when your nick is mentioned in them. Use the following code snippet:

(rcirc-track-minor-mode 1)

(setq neale/rcirc-ignored-channels
	"#emacs" "#guile" "#guix" "#lisp" "#scheme" "#rcirc"

(defun neale/rcirc-print-function (process sender response target text)
  (if (not (eq target nil))
      (with-current-buffer (rcirc-get-buffer process target)
         ((and (equal sender (rcirc-nick process))
               (equal response "JOIN"))
          (when (member target neale/rcirc-ignored-channels)
            (setq rcirc-ignore-buffer-activity-flag t)))))))

(add-hook 'rcirc-print-functions 'neale/rcirc-print-function)

For developers:

A todo list for manual maintainers

Questions & Answers

VincentFoley asks: could anyone describe the differences between rcirc and ERC from an end-user point of view?

AlexSchroeder replies: For beginners, there should be no significant differences. After all, both claim to be easy-to-use IRC clients. The differences begin when customizing or hacking it. Neither of the two has introduced radical changes to the user interface.

WeakishJiang: I have not used ERC. But I found this piece on this page:

   I used ERC for a while, but I was not very fond of the 20 odd files required in 
   my elisp directory, so I switched to rcirc and haven’t looked back since. It does
   everything I need, the (very clean) code is contained in a single file, I’m very happy! 
   – VincentFoley

Hope it helps.