dot/ercrc.el: Rearrange bot greeting.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 7 Nov 2012 11:21:03 +0000 (11:21 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 7 Nov 2012 11:21:03 +0000 (11:21 +0000)
Maintaining a master list of all known bots and managing the credentials
out of band is a nightmare.  Instead, keep the knowledge about bots and
how to greet them together, and just leave the machinery common.

dot/ercrc.el

index 55f67fb..54f8abb 100644 (file)
@@ -2,7 +2,6 @@
 ;;;
 ;;; ERC configuration
 
-(load "~/.erc-auth.el")
 (setq erc-nick "mdw"
       erc-user-full-name "Mark Wooding")
 
        ("chiark.greenend.org.uk" "#chiark")
        ("irc.distorted.org.uk" "#distorted" "#jukebox")))
 
-(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))
-    ("chiark.greenend.org.uk" "blight"
-     ,(format "identpass mdw %s" mdw-blight-password))
-    ("tunnel.chiark.greenend.org.uk" "blight"
-     ,(format "identpass mdw %s" mdw-blight-password))
-    ("irc.distorted.org.uk" "blight"
-     ,(format "identpass mdw %s" mdw-distorted-password)))
+(defvar mdw-erc-auto-greet-bots-alist nil
   "*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-define-bot-greeting (server bot greeting)
+  "Define a new bot greeting."
+  (push (list server bot greeting) mdw-erc-auto-greet-bots-alist))
+(load "~/.erc-auth.el")
+
 (defun mdw-erc-auto-greet-bots (server nick)
   "Send greeting message to bots."
   (dolist (l mdw-erc-auto-greet-bots-alist)