rcirc is an IRC client. It blends seamlessly with Emacs and has sane defaults. rcirc is part of GNU Emacs since release 22.0.
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:
nickserv &c
. 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
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
(setq gnutls-min-prime-bits 1024)
Common keybindings:
C-h m
– List keybindings.C-c C-j
– Join a channelC-c RET
– Send a /msg
C-c Cn
– List users in channelC-c C-r
– Change nickC-c C-b
– Open URL under point. Common IRC commands (tab-completable):/help [command]
– Describe a command./info
– Display server info/part
– Leave channel./join
– Join a channel./time
– Display server’s local time./motd
– Display the Message of the Day./whois
– More info about a nick./away
– Tell users you aren’t available./topic #guile
– Display topic string /color
– Color each nick seperately.pals
and bots
./retake
– send RECOVER and RELEASE messages to !NickServ
./reconnect
– Quit and reconnect immediately (e.g. if you enter sleep mode)./pounce
, /unpounce
– store messages for people and send them when they’re online./all
– Run a command (such as /away
) for all connections/sv
– Show version number./help
– list rcirc commands and show their documentation‘rcirc-dim-nicks’
.‘rcirc-connect’
/occur
– find stuff in all your rcirc buffers/op
, /deop
, /mute
, /unmute
, /ban
, /unban
, /kickban
rcirc-activities/switch-to-buffer
to see and switch to buffers with activities, using ido. ‘M-x bs-show’
users(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)
For reply to sender in a group (say, bitlbee
when non-private
)
(defun my/rcirc-reply nil "With point on message, prepares for a message to the same nick." (interactive ) (let* ((pos (end-of-line)) (nick-other (progn (while (not (memq 'rcirc-other-nick (get-char-property (goto-char (previous-single-property-change (point) 'font-lock-face)) 'font-lock-face))) (setq pos (point))) (buffer-substring-no-properties (point) pos)))) (goto-char rcirc-prompt-end-marker) (insert nick-other ": ")))