1 ;;(setq erc-nick "poppyer") ;; seems no use
2 ;; (erc-select :server "irc.freenode.net" :port 6667
3 ;; :nick "davidmccabe" :full-name "David McCabe" :password "xxx")
5 ;;(setq erc-hide-list '("JOIN" "PART" "QUIT" "MODE"))
6 (setq erc-hide-list
'("MODE"))
7 (setq erc-header-line-format nil
)
8 (setq erc-fill-column
98)
11 (setq erc-track-exclude-types
'("NICK" "JOIN" "PART" "QUIT"))
13 (define-key erc-mode-map
(kbd "C-c C-c") 'erc-track-switch-buffer
) ;; default erc-toggle-interpret-controls
16 (require 'erc-nick-colors
)
18 (defun my-quit-color-dehighlight ()
20 (goto-char (point-min))
21 (if (looking-at "\\*\\*\\*.*has \\(quit\\|left\\)")
22 (put-text-property (point-min) (point-max)
23 'face
(list :foreground
"gray")
27 ;; This adds the ERC message insert hook.
28 (add-hook 'erc-insert-modify-hook
'my-quit-color-dehighlight
)
31 (defun my-name-changed-formatter ()
33 (goto-char (point-min))
34 (when (looking-at ".*`\\(.*\\)' changed name from `\\(.*\\)' to `\\(.*\\)'")
35 (goto-char (1- (match-beginning 3)))
37 (goto-char (1- (match-beginning 2)))
41 (add-hook 'erc-insert-modify-hook
'my-name-changed-formatter
)
44 (setq bitlbee-filter-name-changed
'( "fund0800" "poppyer2001"))
46 (defun my-name-changed-filter (s)
47 (when (string-match "`\\(.*\\)' changed name from `\\(.*\\)' to `\\(.*\\)'" s
)
48 (let ((user (substring s
(match-beginning 1) (match-end 1)))
49 (from (substring s
(match-beginning 2) (match-end 2)))
50 (to (substring s
(match-beginning 3) (match-end 3))))
51 (dolist (filtered-user bitlbee-filter-name-changed
)
52 (when (string= user filtered-user
)
53 (setq erc-insert-this nil
)
60 (add-hook 'erc-insert-pre-hook
'my-name-changed-filter
)
63 (require 'erc-speedbar
)
64 (setq erc-speedbar-sort-users-type
'alphabetical
)
69 (setq erc-autojoin-channels-alist
70 '( ("freenode.net" "#og-zh ogm185286")
74 ;; (add-to-list 'erc-modules 'scrolltobottom)
75 ;; (setq erc-input-line-position -2)
77 ;; my logging for bitlbee only (localhost)
78 (add-to-list 'erc-modules
'log
)
79 (setq erc-log-file-coding-system
'utf-8
)
80 (setq erc-log-write-after-insert t
)
81 (setq erc-save-buffer-on-part nil
)
82 (setq-default erc-enable-logging
'(lambda(buffer)
84 (erc-log-all-but-server-buffers buffer
)
85 (string= "localhost" erc-session-server
)
86 (not (string= "&bitlbee" (buffer-name buffer
)))
93 ;;(setq erc-log-insert-log-on-open nil) ;;default
94 ;;(setq erc-log-channels t) ;;unknown???
95 ;;(setq erc-log-channels-directory "~/.irclogs/")
96 ;;(setq erc-save-buffer-on-part t) ;;default
97 ;;(setq erc-hide-timestamps nil) ;;default
99 ;;(defadvice save-buffers-kill-emacs (before save-logs (arg) activate)
100 ;; (save-some-buffers t (lambda () (when (and (eq major-mode 'erc-mode)
101 ;; (not (null buffer-file-name)))))))
103 ;;(add-hook 'erc-insert-post-hook 'erc-save-buffer-in-logs)
104 ;;(add-hook 'erc-mode-hook '(lambda () (when (not (featurep 'xemacs))
105 ;; (set (make-variable-buffer-local
106 ;; 'coding-system-for-write)