Emacs: nettoyage
[dotfiles.git] / emacs / tt25-erc.el
1 ;; -*- emacs-lisp -*-
2
3 ;; Fichier de configuration de ERC (Client IRC pour Emacs)
4 ;; Author: Olivier Tetard <olivier.tetard@miskin.fr>
5 ;; URL : http://toutoune25.miskin.fr/
6
7 ;; This file is free software; you can redistribute it and/or modify it
8 ;; under the terms of the GNU General Public License as published by the
9 ;; Free Software Foundation; either version 2, or (at your option) any
10 ;; later version.
11
12 ;; This file is distributed in the hope that it will be useful, but
13 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 ;; General Public License for more details.
16
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with GNU Emacs; see the file COPYING. If not, write to the Free
19 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 ;; 02111-1307, USA.
21
22 ;; ,----
23 ;; | Configuration générale :
24 ;; `----
25
26 (setq erc-user-full-name "Olivier Tétard")
27 (setq erc-email-userid "toutoune25")
28 (setq erc-nick "toutoune25")
29
30 ;; disabled: bbdb
31 (setq erc-modules (quote (autojoin button fill log match
32                                    netsplit notify pcomplete
33                                    completion readonly ring
34                                    scrolltobottom services smiley
35                                    sound stamp track nickserv)))
36
37 ;; Autojoin
38 (setq erc-autojoin-channels-alist
39       '(("\\(geeknode.org\\|esigetel.fr\\)" "#calvix" "#Troll" "#linux")
40         ("irc.wikimedia.org" "#fr.wikiquote")
41         ("freenode.net" "#miskin" "#arsouyes" "#wikiquote-fr" "#pycorr")))
42
43 ;; Higlight
44 (setq erc-current-nick-highlight-type 'all)
45 (setq erc-keywords '("\\toutoune25\\b"))
46 (setq erc-pals '("plop42"))
47
48 ;; On s'identifie automatiquement
49 (setq erc-nickserv-passwords
50       '((freenode 
51          (("toutoune25" . irc_password)))))
52
53 ;; On s'identifie aussi sur Geeknode (pas de NickServ)
54 (add-hook 'erc-after-connect
55           '(lambda (SERVER NICK)
56              (cond
57               ((string-match "\\(geeknode.org\\|esigetel.fr\\)" SERVER)
58                (erc-message "PRIVMSG" (concat "C nick identify " irc_password))))))
59
60 ;; Tracking
61 (setq erc-track-exclude '("auth" "nickop" "root"))
62 (setq erc-track-exclude-types '("NICK" "QUIT" "JOIN" "PART"))
63
64 ;; On logge tout 
65 (setq erc-enable-logging t)
66 (setq erc-log-channels-directory "~/.erc/logs/")
67
68 ;; Function
69 ;; (http://members.iinet.net.au/~striggs/elisp/mst-erc.el)
70 (defun erc-mst-log (buffer target nick server port)
71   (downcase (format "%s/%s-%s.log" erc-log-channels-directory
72                     server target)))
73 ;; ,----
74 ;; | Affichage :
75 ;; `----
76
77 ;; Largeur de la zone de texte
78 (setq erc-fill-column 110)
79
80 ;; On aligne les nicknames
81 (setq erc-fill-function 'erc-fill-static)
82 (setq erc-fill-static-center 15)
83
84 ;; Timestamps
85 (setq erc-timestamp-only-if-changed-flag nil)
86 (setq erc-timestamp-format "[%R] ")
87 (setq erc-fill-prefix "      ")
88 (setq erc-insert-timestamp-function 'erc-insert-timestamp-left)
89
90 ;; On affiche les timestamps
91 (setq erc-hide-timestamps nil)
92
93 ;; Prompt
94 (setq erc-prompt 
95       (lambda ()
96         (if 
97             (and 
98              (boundp 'erc-default-recipients) 
99              (erc-default-target))
100             (erc-propertize (concat (erc-default-target) ">") 'read-only t 'rear-nonsticky t 'front-nonsticky t)
101           (erc-propertize (concat "ERC>") 'read-only t 'rear-nonsticky t 'front-nonsticky t))))
102
103 ;; Auto query
104 (setq erc-auto-query 'buffer)
105
106 ;; On veut que les NOTICE affichent une nouvelle frame aussi
107 (add-hook 'erc-after-connect
108           (lambda (server nick)
109             (add-hook 'erc-server-NOTICE-hook 'erc-auto-query)))
110
111 ;; On veut buttonizer *toutes* les URLs (meme google.com)
112 (setq erc-button-url-regexp
113       "\\([-a-zA-Z0-9_=!?#$@~`%&*+\\/:;,]+\\.\\)+[-a-zA-Z0-9_=!?#$@~`%&*+\\/:;,]*[-a-zA-Z0-9\\/]")
114
115 ;; Son
116 (setq erc-sound-path '("~/.erc/sounds"))
117 (setq erc-default-sound "~/.erc/sounds/ni.wav")
118 (setq erc-play-command "aplay")
119
120 ;; Vrac
121 (setq erc-netsplit-regexp "^$") ; foil erc-netsplit..
122 (setq erc-verbose-dcc nil)
123 (setq erc-save-buffer-on-part t)
124 (setq erc-save-queries-on-quit t)
125 (setq erc-generate-log-file-name-function 'erc-mst-log)
126 (setq erc-track-visibility nil)
127 (setq erc-log-insert-log-on-open nil)
128 (setq erc-prompt-for-password nil)
129
130 (custom-set-faces
131  '(erc-current-nick-face 
132    ((t (:foreground "red" :slant oblique :background: "yellow")))))
133
134 (provide 'tt25-erc)