dot/ercrc.el: Common configuration for ERC.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 19 Dec 2010 03:13:01 +0000 (03:13 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 19 Dec 2010 03:13:01 +0000 (03:13 +0000)
dot/ercrc.el [new file with mode: 0644]
setup

diff --git a/dot/ercrc.el b/dot/ercrc.el
new file mode 100644 (file)
index 0000000..df45479
--- /dev/null
@@ -0,0 +1,45 @@
+;;; -*-emacs-lisp-*-
+;;;
+;;; ERC configuration
+
+(load "~/.erc-auth.el")
+(setq erc-nick "mdw"
+      erc-user-full-name "Mark Wooding")
+
+(setq erc-fill-column 77
+      erc-timestamp-right-column 69
+      erc-fill-prefix "   ")
+
+(load "~/.erc-local.el")
+
+(setq erc-track-exclude-types '("NICK" "JOIN" "PART"))
+
+(setq erc-auto-query 'buffer)
+
+(setq erc-autojoin t
+      erc-autojoin-domain-only nil
+      erc-autojoin-channels-alist
+      '(("irc.ssdis.loc" "#devel" "#jukebox" "#nextgen")
+       ("cam.irc.devel.ncipher.com"
+        "#devel" "#jukebox" "#nextgen" "#sec-team")
+       ("localhost:16667" "#chiark")))
+
+(defvar mdw-erc-auto-greet-bots-alist
+  `(("irc.ssdis.loc" "fastness"
+     ,(format "identpass mwooding %s" mdw-fastness-password))
+    ("cam.irc.devel.ncipher.com" "fastness"
+     ,(format "identpass mwooding %s" mdw-fastness-password))
+    ("localhost:16667" "blight"
+     ,(format "identpass mdw %s" mdw-blight-password)))
+  "*Alist of (SERVER-REGEXP BOT-NICK MESSAGE-FORM).
+Evaluate MESSAGE-FORM and sent to BOT-NICK when connected to a server which
+matches SERVER-REGEXP.")
+
+(defun mdw-erc-auto-greet-bots (server nick)
+  "Send greeting message to bots."
+  (dolist (l mdw-erc-auto-greet-bots-alist)
+    (when (string-match (car l) server)
+      (let ((bot (cadr l))
+           (message (caddr l)))
+       (erc-server-send (concat "PRIVMSG " bot " :" message))))))
+(add-hook 'erc-after-connect 'mdw-erc-auto-greet-bots)
diff --git a/setup b/setup
index 499841e..76b95db 100755 (executable)
--- a/setup
+++ b/setup
@@ -129,7 +129,7 @@ fi
 ## Symlink the various dotfiles into place
 dotfiles="
   bash_profile bash_logout bashrc inputrc bash_completion
-  emacs emacs-calc vm gnus.el
+  emacs emacs-calc vm gnus.el ercrc.el
   vimrc mg zile
   mailrc signature
   cgrc tigrc