rcirc

rcirc is an IRC client. It blends seamlessly with Emacs and has sane defaults.

rcirc is part of GNU Emacs since release 22.0.

Quickstart

Add a server in your InitFile, then Start rcirc with M-x irc:

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

(setq rcirc-server-alist
      '(("irc.libera.chat" ; Hostname
       :port 6697          ; Standard port for secure IRC
       :nick "linen"       ; Your nickname
       :encryption tls     ; Specify to use encryption
       :channels ("#rcirc" "#emacs" "#emacswiki"))))

To get started, see also:

Using SSL

SSL comes with Emacs >= 24, but rcirc must enable it first (as we do above)

Emacs must be built with GNU TLS. On Windows, you can download GnuTLS. Make sure bin is in your PATH. Test it by running gnutls-cli from Eshell:

Welcome to the Emacs shell

~ $ gnutls-cli
No hostname specified
If you get the following error:
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
Add the following to your init file:
(setq gnutls-min-prime-bits 1024)

Commands

Common keybindings:

Common IRC commands (tab-completable):

Addons

Related Stuff

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)

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" "#guix" "#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)
        (cond
         ((and (equal sender (rcirc-nick process))
               (equal response "JOIN"))
          (rcirc-omit-mode)
          (when (member target neale/rcirc-ignored-channels)
            (setq rcirc-ignore-buffer-activity-flag t)))))))

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

CategoryChatClient