InternetRelayChat

Last edit

Summary: make clear it's rcirc

Changed:

< Here's an example robot which implements a ping/pong conversation:

to

> Here's an example robot which implements a ping/pong conversation with ##rcirc##:


There are various IRC channels dedicated to Emacs around. Here is a list of the known ones:

Related:

Clients

There are also Emacs based IRC clients:

Help For Newbies

Documentation For Developers

Emacs IRC Client Recommendations

I used ERC and switched to rcirc in 2005. – AlexSchroeder

I use ERC (EmacsIRCClient) too:

Some comments about clients I tried:

If you are looking for a client which does it “the Emacs way”, ZenIRC and ERC are definitely for you. ERC has some extra features over ZenIRC like colour display as well as the possibility to display a separate info buffer for every channel. Have a look at both and compare them yourself.

Liece (LieceIrcClient) and IrChat both take a somewhat different approach. You get an input buffer for commands and a separate buffer where the channel/query content go into. Some people like that. IrChat is kind of freaky because it supports different cryptographic algorithms as well as DCC implemented through an external perl script.

For EmacSpeak users, there are speech enabling extension for EmacsIRCClient and ZenIRC. I have also written erc-speak.el which allows you to listen to channel content using EmacSpeak. You can grab erc-speak.el from the EmacsIRCClient CVS.

MarioLang

me too! I use ERC!! --ShaeErisson

I love ERC. Man, It just rocks – GirishB

ERC is just about the coolest thing ever. – EdwardOConnor

There was a time when I scoffed at the idea of IRCing in emacs. Since I discovered ERC, that time has passed. :-) – DamienElmes

I’ve been using ZenIRC for a long time before I discovered ERC. ZenIRC had some features that I missed in ERC (and still miss, somehow), most of which we ported over. Now, ERC has become the best IRC client I know and I use it nearly daily. – AndreasFuchs

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

Emacs and IRC

    <Khmar> I don't think RMS ever imagined that people would
      throw an IRC client into his editor.
    <delYsid> there are 4 or 5 for emacs actually
    <delYsid> liece, riece, zenirc, erc and one I forgot
    <delYsid> did you guys know that Ben (one of the Zenirc
      authors) wrote the ctcp spec?
    <resolve> the irc client for real gurus! m-x
      make-network-connection :_)
    <resolve> delYsid: nope. cool!
    <delYsid> 1992
    <delYsid> so one emacs irc client was actually actively
      involved in the early irc design times

The original IRC client in elisp was by David Lawrence at RPI in 1989, named irc.el (oldest extant copy linked). This code was actively developed through 1996 by various people before finally sinking into obscurity. It is doubtful that this client still functions on modern IRC networks. (It actually does work… I use it every day – I’m a bit sentimental towards it since some of my code made it into the final release. – RandalSchwartz?)

Emacs IRC Bouncer

A bouncer is like an IRC proxy server. It connects to IRC and you connect to it. The idea is that you can put your bouncer on a permanent Internet host and then connect to it from your laptop (or multiple locations, or whatever) that is less permanently connected.

Several different bouncers are available but NicFerrier has written ShoesOff in EmacsLisp.

IRC Robots in EmacsLisp

A number of robots have been written in EmacsLisp using ERC or rcirc.

Here’s an example robot which implements a ping/pong conversation with rcirc:

;;; ircpinger.el - rcirc robot to respond to pings
(require 'cl)
(defconst ircpinger-nick "pinger-robot"
  "The IRC nick of the robot.")
(defconst ircpinger-joinlist '()
  "List of channels the robot should join.")
(defconst ircpinger-server ""
  "Server name to connect to.")
(defconst ircpinger-logging nil)

(defun ircpinger-robot-channel-buffer-list ()
  (mapcar
   (lambda (e)
     (let ((name (buffer-name e)))
       (string-match "^#\\([A-Za-z0-9.-]+\\).*" name)
       (cons (match-string 1 name) name)))
   (remove-if
    (lambda (e)
      (with-current-buffer e
        (not (eq major-mode 'rcirc-mode))))
    (buffer-list))))

(defun ircpinger-robot-ping-hook (process cmd sender args text)
  (when (equal cmd "PRIVMSG")
    (let* ((m (string-match ".* PRIVMSG #\\([A-Za-z.-]+\\) :\\(.*\\)" text))
           (chan (when m (match-string 1 text)))
           (txt (when m (match-string 2 text))))
      (if (and txt (equal txt ",ping"))
          (let* ((channel-alist (ircpinger-robot-channel-buffer-list))
                 (channel (assoc chan channel-alist)))
            (with-current-buffer (get-buffer  (cdr channel))
              (save-excursion
                (goto-char (point-max))
                (insert (format "%s: pong" sender))
                (rcirc-send-input))))
        ;; else
        (when ircpinger-logging
          (message "whoops! %s" text))))))                                                                

(defun ircpinger-init ()
  "Initialize the robot."
  (interactive)
  (rcirc-connect
   ircpinger-server 6667 ircpinger-nick
   "pinger-robot" "emacs robot" ircpinger-joinlist)
  (add-hook 'rcirc-receive-message-hooks 'ircpinger-robot-ping-hook))

(defun ircpinger-stop ()
  "Remove the robot hook."
  (interactive)
  (remove-hook 'rcirc-receive-message-hooks 'ircpinger-robot-ping-hook))

;;; ircpinger.el ends here    

CategoryChatClient CategoryHelp