Linux, musical road-dogging, and daily life by Paul W. Frields
 
Emacs and ERC.

Emacs and ERC.

Dear Lazyweb: I’m trying out Emacs as an IRC client (via ERC) and realize that I could probably use some tuning to make it work well. I’m wondering whether anyone in the Fedora community has a set of scripts they use to do some of the following:

  • Auto-login to several networks and start up channels in some of them
  • Produce notifications via D-Bus or libnotify

OK, I haven’t done a ton of investigation yet, too much else on my plate so I have to get a Round Tuit when I can. If you have a set of goodies that work well for you, let me know.

Comments such as “use another client” will be cheerfully deleted. ? This is just an experiment, since I regularly use other clients like irssi and xchat-gnome.

4 Comments

  1. Yep, I use ERC too. Here’s a selection from my .emacs. For notifications with libnotify, see //www.emacswiki.org/emacs/ErcPageMe.

    (require 'erc)
    (require 'erc-stamp)
    (erc-timestamp-mode 1)

    ;; Create new windows for new private messages.
    (setq erc-auto-query t)

    ;; Ignore these changes on the modeline notifications
    (setq erc-track-exclude-types ‘(“JOIN” “NICK” “PART” “QUIT”))

    (defun erc-register-connection (command server port nick)
    “Create interactive command command', for connecting to an IRC server. The
    command uses interactive mode if passed an argument."
    (fset command
    (lambda (arg) (interactive “p”)
    (if (= 1 arg)
    (erc ,server ,port ,nick erc-user-full-name t)
    (erc-select ,server ,port ,nick)))))

    (erc-register-connection ‘erc-fn “irc.freenode.net” 6667 “cjb”)
    (erc-register-connection ‘erc-fn “irc.oftc.net” 6667 “cjb”)

    (setq erc-fill-column 78)
    (setq erc-user-full-name “Your Name”)
    (setq erc-max-buffer-size 200000)

    (require ‘erc-truncate)
    (defvar erc-insert-post-hook)
    (add-hook ‘erc-insert-post-hook
    ‘erc-truncate-buffer)
    (setq erc-truncate-buffer-on-save t)
    (setq erc-prompt “>>”)
    (setq erc-prompt-for-password nil)
    (setq erc-prompt-interactive-input t)
    (setq erc-hide-timestamps nil)
    (add-hook ‘erc-insert-modify-hook ‘erc-fill)
    (add-hook ‘erc-send-modify-hook ‘erc-fill)

    (erc-select :server “irc.freenode.net” :port 6667)
    (erc-select :server “irc.oftc.net” :port 6667)

    ;; Join some channels.
    (defun freenode-join (channelname)
    (with-current-buffer “irc.freenode.net:6667”
    (erc-cmd-JOIN channelname)))

    (defun oftc-join (channelname)
    (with-current-buffer “irc.oftc.net:6667”
    (erc-cmd-JOIN channelname)))

    (freenode-join “#channel1”)
    (freenode-join “#channel2”)
    (oftc-join “#channel3”)
    (oftc-join “#channel4”)

  2. adam stokes

    ‘(erc-autoaway-idle-method (quote user))
    ‘(erc-autoaway-mode t)
    ‘(erc-autojoin-channels-alist (quote ((“irc.freenode.net” “#augeas” “fedora”))))
    ‘(erc-autojoin-mode t)
    ‘(erc-hide-list (quote (“JOIN” “KICK” “NICK” “PART” “QUIT” “MODE”)))
    ‘(erc-join-buffer (quote bury))
    ‘(erc-kill-buffer-on-part t)
    ‘(erc-nick “stokachu”)
    ‘(erc-prompt “moo>”)
    ‘(erc-quit-reason-various-alist nil)
    ‘(erc-server “irc.devel.redhat.com”)
    ‘(erc-user-full-name “adam stokes”)
    (custom-set-faces
    ;; custom-set-faces was added by Custom.
    ;; If you edit it by hand, you could mess it up, so be careful.
    ;; Your init file should contain only one such instance.
    ;; If there is more than one, they won’t work right.
    ‘(erc-input-face ((t (:foreground “orange”))))
    ‘(erc-my-nick-face ((t (:background “black” :foreground “orange” :weight bold)))))

Comments are closed.