X-Git-Url: https://git.distorted.org.uk/~mdw/profile/blobdiff_plain/129a1a0c99dbc61c2b3c02c1d5c388574082820b..393e450ba47288aba552c230c60140f70197f545:/dot/ercrc.el diff --git a/dot/ercrc.el b/dot/ercrc.el index d035c64..a0bc5a6 100644 --- a/dot/ercrc.el +++ b/dot/ercrc.el @@ -5,15 +5,35 @@ (setq erc-nick "mdw" erc-user-full-name "Mark Wooding") -(if (not (memq 'truncate erc-modules)) - (setq erc-modules (cons 'truncate erc-modules))) +(dolist (module '(replace truncate)) + (if (not (memq module erc-modules)) + (setq erc-modules (cons module erc-modules)))) (setq erc-fill-column 76 erc-timestamp-right-column 68 erc-fill-prefix " " erc-max-buffer-size (* 60 3000)) -(load "~/.erc-local.el") +;; Filter out emoji, which cause severe display confusion. +(defun mdw-replace-wide-characters (string) + (with-output-to-string + (let ((i 0) + (state nil)) + (while (< i (length string)) + (let ((ch (aref string i))) + (cond ((and (= (char-width ch) 1) + (not (or (<= #x1f200 ch #x1ffff)))) + (when state (princ "*]") (setf state nil)) + (write-char ch)) + (t + (princ (if state "*" "[*")) + (princ (format "#x%x" ch)) + (setf state t)))) + (setq i (1+ i))) + (when state (princ "*]"))))) + +(setq erc-replace-alist + '(("[[:nonascii:]+]" . mdw-replace-wide-characters))) (setq erc-track-exclude-types '("NICK" "JOIN" "PART")) @@ -30,12 +50,10 @@ (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") - ("chiark.greenend.org.uk" "#chiark") + '(("chiark.greenend.org.uk" "#chiark") ("irc.distorted.org.uk" "#distorted" "#jukebox") ("irc.hstg.corp.good.com" "#hstg"))) +(erc-autojoin-mode 1) (defvar mdw-erc-auto-greet-bots-alist nil "*Alist of (SERVER-REGEXP BOT-NICK MESSAGE-FORM). @@ -96,7 +114,6 @@ Evaluation order for the keywords is a bit screwy: don't rely on it." (mdw-pushnew-replace (list server acct passwd) mdw-erc-ircop-alist :test #'string= :key #'car)) -(load "~/.erc-auth.el") (defun mdw-assoc-regexp (regexp alist) "Return the association in ALIST whose car matches REGEXP." @@ -126,3 +143,6 @@ Evaluation order for the keywords is a bit screwy: don't rely on it." (let ((acct (cadr a)) (passwd (caddr a))) (erc-server-send (concat "OPER " acct " " passwd)))))) + +(load "~/.erc-auth.el") +(load "~/.erc-local.el")