;; ERC (require 'erc) (require 'erc-nicklist) (setq erc-echo-notices-in-minibuffer-flag t) (defun reset-erc-track-mode () (interactive) (setq erc-modified-channels-alist nil) (erc-modified-channels-update)) (global-set-key (kbd "C-c r") 'reset-erc-track-mode) (setq erc-current-nick-highlight-type 'arnau) (setq erc-default-coding-system (quote (iso-8859-15 . undecided))) (setq erc-server-coding-system (quote (iso-8859-15 . undecided))) (setq erc-hide-list '("MODE")) ;; --- Tracking active IRC-buffers --- ;; go to working buffer when no more active IRC buffers (setq erc-track-switch-from-erc t) (setq erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT")) ;; (setq erc-track-use-faces t) ;; (setq erc-track-faces-priority-list ;; '(erc-current-nick-face erc-keyword-face)) ;; (setq erc-track-priority-faces-only 'all) (setq erc-input-line-position -2) ;; Here is a slightly more complex erc-after-connect hook: (add-hook 'erc-after-connect '(lambda (SERVER NICK) (cond ((string-match "freenode\\.net" SERVER) (erc-message "PRIVMSG" "NickServ identify foo")) ((and (string-match "irc\\.milkypond\\.org" SERVER) (= 6667 erc-session-port)) (erc-message "PRIVMSG" "NickServ identify foo")) ((string-match "oftc\\.net" SERVER) (erc-message "PRIVMSG" "NickServ identify foo")) ((string-match "gimp\\.org" SERVER) (erc-message "PRIVMSG" "NickServ identify foo")) ((= 6668 erc-session-port) (erc-message "PRIVMSG" "&bitlbee identify foo"))))) (require 'erc-autojoin) (erc-autojoin-mode 1) ;;(defun duckcorp-join() ;; (if (and (= 6667 erc-session-port) ;; (string-match "toushirou\\.duckcorp\\.org" erc-session-server)) ;; '("#milkypond" "#news" "#duckcorp")) ;; '()) (setq erc-autojoin-channels-alist '(("freenode.net" "#hurdfr" "#emacs" "#gnus" "#andesi" "#guilde" "#turbogears" "#lavily") ("irc.milkypond.org" "#milkypond" "#news" "#duckcorp") ("gimp.org" "#GNOME-Debian") ("oftc.net" "#debian-python" "#debian-devel" "#debian-devel-fr" "#fingerforce" "debian-bugs" "#bitlbee"))) (require 'erc-match) (setq erc-keywords '("arnau" "arnal")) (erc-match-mode) (require 'erc-track) (erc-track-mode t) ; was (erc-track-modified-channels-mode t) ; Note: erc-track-modified-channels-mode changed ; to erc-track-mode as of erc-track.el ; CVS revision 1.23 (November 2002) ;; Read-only (add-hook 'erc-insert-post-hook 'erc-make-read-only) (add-hook 'erc-send-post-hook 'erc-make-read-only) (add-hook 'erc-mode-hook '(lambda () (require 'erc-pcomplete) (pcomplete-erc-setup) (erc-completion-mode 1))) (require 'erc-fill) (erc-fill-mode t) (require 'erc-ring) (erc-ring-mode t) (require 'erc-netsplit) (erc-netsplit-mode t) (erc-timestamp-mode t) (setq erc-timestamp-only-if-changed-flag nil erc-timestamp-format "[%R-%m/%d] " erc-fill-static-center 20 erc-fill-prefix " " erc-flood-protect nil erc-insert-timestamp-function 'erc-insert-timestamp-left) (add-hook 'window-configuration-change-hook '(lambda () (setq erc-fill-column (- (window-width) 2)))) (add-hook 'erc-mode-hook (lambda () (auto-fill-mode 0))) (erc-button-mode nil) ;slow (setq erc-user-full-name "Arnaud Fontaine") (setq erc-email-userid "arnaud@andesi.0rg") ;; logging: (setq erc-log-insert-log-on-open nil) (setq erc-log-channels t) (setq erc-log-channels-directory "~/.erclogs/") (setq erc-save-buffer-on-part t) (setq erc-hide-timestamps nil) (defadvice save-buffers-kill-emacs (before save-logs (arg) activate) (save-some-buffers t (lambda () (when (and (eq major-mode 'erc-mode) (not (null buffer-file-name))))))) (add-hook 'erc-insert-post-hook 'erc-save-buffer-in-logs) (add-hook 'erc-mode-hook '(lambda () (when (not (featurep 'xemacs)) (set (make-variable-buffer-local 'coding-system-for-write) 'emacs-mule)))) ;; when exiting emacs, save all logs without confirmation (defadvice save-buffers-kill-emacs (before save-logs (&rest args) activate) (save-some-buffers t (lambda () (when (and (eq major-mode 'erc-mode) (not (null buffer-file-name))) t)))) ;; Truncate buffers so they don't hog core. (setq erc-max-buffer-size 20000) (defvar erc-insert-post-hook) (add-hook 'erc-insert-post-hook 'erc-truncate-buffer) (setq erc-truncate-buffer-on-save t) ;; Clears out annoying erc-track-mode stuff for when we don't care. ;; Useful for when ChanServ restarts :P (defun reset-erc-track-mode () (interactive) (setq erc-modified-channels-alist nil) (erc-modified-channels-update)) (global-set-key (kbd "C-c r") 'reset-erc-track-mode) ;;; Finally, connect to the networks. (defun irc-maybe () (interactive) (when (y-or-n-p "IRC? ") (erc "irc.freenode.net" 6667 "arnal" "Arnaud Fontaine" t "") (erc "irc.milkypond.org" 6667 "arnau" "Arnaud Fontaine" t "") (erc "irc.oftc.net" 6667 "arnau" "Arnaud Fontaine" t "") (erc "irc.gimp.org" 6667 "arnau" "Arnaud Fontaine" t "") (erc "toushirou.duckcorp.org" 6668 "arnau" "Arnaud Fontaine" t ""))) ;; (erc "im.rootdir.de" 6668 "arnau" "Arnaud Fontaine" t ""))) ;; Bitlbee (add-hook 'erc-join-hook 'bitlbee-identify) (defun bitlbee-identify () "If we're on the bitlbee server, send the identify command to the #bitlbee channel." (when (and (string= "toushirou.duckcorp.org" erc-session-server) (= 6668 erc-session-port) (string= "&bitlbee" (buffer-name)) (string= "toushirou\\.duckcorp\\.org" (system-name))) (erc-send-command (format "PRIVMSG &bitlbee :identify %s" blb-pwd)))) ;; ICQ query (defun erc-cmd-ICQWHOIS (uin) "Queries icq-user with UIN `uin', and returns the result." (let* ((result (myerc-query-icq-user uin)) (fname (cdr (assoc 'fname result))) (lname (cdr (assoc 'lname result))) (nick (cdr (assoc 'nick result)))) (erc-display-message nil 'notice (current-buffer) (format "%s (%s %s)" nick fname lname)))) (add-hook 'erc-mode-hook '(lambda () (define-key erc-mode-map "\C-a" '(lambda () (interactive) (let ((p (point))) (erc-bol) (if (= p (point)) (beginning-of-line))))))) ;; Prompt (setq erc-prompt (lambda () (if (and (boundp 'erc-default-recipients) (erc-default-target)) (erc-propertize (concat (erc-default-target) ">") 'read-only t 'rear-nonsticky t 'front-nonsticky t) (erc-propertize (concat "ERC>") 'read-only t 'rear-nonsticky t 'front-nonsticky t)))) ;; URL (setq erc-button-url-regexp "\\([-a-zA-Z0-9_=!?#$@~`%&*+\\/:;,]+\\.\\)+[-a-zA-Z0-9_=!?#$@~`%&*+\\/:;,]*[-a-zA-Z0-9\\/]") ;; Autoaway (setq erc-autoaway-idle-seconds 1200) (setq erc-autoaway-message "I'm gone (autoaway after %i seconds of idletime)") (defun erc-cmd-SLAP (&rest nick) (erc-send-action (erc-default-target) (concat "slaps " (car nick) " around the solar system " "-- just out of spite!"))) ;;; --- DCC --- (require 'erc-dcc) (setq erc-dcc-verbose nil) (defun my-query-kb (server nick) (when (string-match "freenode\\.net" server) (erc-cmd-QUERY "kilobug"))) (defun my-query-duck (server nick) (when (string-match "toushirou\\.duckcorp\\.org" server) (erc-cmd-QUERY "Duck"))) (defun my-query-manuel (server nick) (when (string-match "freenode\\.net" server) (erc-cmd-QUERY "manuel"))) (add-hook 'erc-after-connect 'my-query-kb) (add-hook 'erc-after-connect 'my-query-manuel) (add-hook 'erc-after-connect 'my-query-duck)