From: Mark Wooding Date: Wed, 7 Nov 2012 11:21:03 +0000 (+0000) Subject: dot/ercrc.el: Rearrange bot greeting. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/10c4d64fb698c4abdf41c6ad16b0ec6e630a2c94?ds=sidebyside dot/ercrc.el: Rearrange bot greeting. 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. --- diff --git a/dot/ercrc.el b/dot/ercrc.el index 55f67fb..54f8abb 100644 --- a/dot/ercrc.el +++ b/dot/ercrc.el @@ -2,7 +2,6 @@ ;;; ;;; ERC configuration -(load "~/.erc-auth.el") (setq erc-nick "mdw" erc-user-full-name "Mark Wooding") @@ -37,21 +36,16 @@ (setq erc-autojoin t ("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)