Created
January 20, 2011 16:03
-
-
Save j2labs/788100 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;;;;;;;; | |
;; erc ;; | |
;;;;;;;;; | |
; http://www.emacswiki.org/emacs/ErcHighlightNicknames | |
(and | |
(require 'erc-highlight-nicknames) | |
(add-to-list 'erc-modules 'highlight-nicknames) | |
(erc-update-modules)) | |
;;; map ctrl-a to beginning of line | |
(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))))))) | |
;;; channel specific prompts (like #emacs) | |
;;; seems to need input before working... | |
(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)))) | |
;;; align nicks and messages along a center | |
(setq erc-fill-function 'erc-fill-static) | |
(setq erc-fill-static-center 20) | |
;;; set the fill width to the window. defaults to 78 | |
(setq erc-fill-column (- (window-width) 2)) | |
(add-hook 'window-configuration-change-hook | |
'(lambda () | |
(setq erc-fill-column (- (window-width) 2)))) | |
;;; change head line face if disconnected | |
(defface erc-header-line-disconnected | |
'((t (:foreground "black" :background "indianred"))) | |
"Face to use when ERC has been disconnected.") | |
(defun erc-update-header-line-show-disconnected () | |
"Use a different face in the header-line when disconnected." | |
(erc-with-server-buffer | |
(cond ((erc-server-process-alive) nil) | |
(t 'erc-header-line-disconnected)))) | |
(setq erc-header-line-face-method 'erc-update-header-line-show-disconnected) | |
;;; kill buffer on /part (aka /leave) | |
(setq erc-kill-buffer-on-part t) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment