dot/ercrc.el: Configure automatic buffer truncation.
[profile] / dot / ercrc.el
1 ;;; -*-emacs-lisp-*-
2 ;;;
3 ;;; ERC configuration
4
5 (load "~/.erc-auth.el")
6 (setq erc-nick "mdw"
7 erc-user-full-name "Mark Wooding")
8
9 (if (not (memq 'truncate erc-modules))
10 (setq erc-modules (cons 'truncate erc-modules)))
11
12 (setq erc-fill-column 76
13 erc-timestamp-right-column 68
14 erc-fill-prefix " "
15 erc-max-buffer-size (* 60 3000))
16
17 (load "~/.erc-local.el")
18
19 (setq erc-track-exclude-types '("NICK" "JOIN" "PART"))
20
21 (setq erc-auto-query 'buffer)
22
23 (defun mdw-erc-turn-off-truncate-lines ()
24 (setq truncate-lines nil
25 truncate-partial-with-windows nil
26 word-wrap t
27 wrap-prefix (concat (propertize " " 'face 'erc-prompt-face)
28 " ")))
29 (add-hook 'erc-mode-hook 'mdw-erc-turn-off-truncate-lines)
30
31 (setq erc-autojoin t
32 erc-autojoin-domain-only nil
33 erc-autojoin-channels-alist
34 '(("irc.ssdis.loc" "#devel" "#jukebox" "#nextgen")
35 ("cam.irc.devel.ncipher.com"
36 "#devel" "#jukebox" "#nextgen" "#sec-team")
37 ("chiark.greenend.org.uk" "#chiark")))
38
39 (defvar mdw-erc-auto-greet-bots-alist
40 `(("irc.ssdis.loc" "fastness"
41 ,(format "identpass mwooding %s" mdw-fastness-password))
42 ("cam.irc.devel.ncipher.com" "fastness"
43 ,(format "identpass mwooding %s" mdw-fastness-password))
44 ("chiark.greenend.org.uk" "blight"
45 ,(format "identpass mdw %s" mdw-blight-password)))
46 "*Alist of (SERVER-REGEXP BOT-NICK MESSAGE-FORM).
47 Evaluate MESSAGE-FORM and sent to BOT-NICK when connected to a server which
48 matches SERVER-REGEXP.")
49
50 (defun mdw-erc-auto-greet-bots (server nick)
51 "Send greeting message to bots."
52 (dolist (l mdw-erc-auto-greet-bots-alist)
53 (when (string-match (car l) server)
54 (let ((bot (cadr l))
55 (message (caddr l)))
56 (erc-server-send (concat "PRIVMSG " bot " :" message))))))
57 (add-hook 'erc-after-connect 'mdw-erc-auto-greet-bots)