summaryrefslogtreecommitdiffstats
path: root/.emacs.d/site-lisp/jabber-init.el
diff options
context:
space:
mode:
authorGravatar Tom Willemse2013-08-14 21:28:02 +0200
committerGravatar Tom Willemse2013-08-14 21:28:02 +0200
commit6d0999e20907345314d8fe8e1c42eb87a7f5ae63 (patch)
tree7c6f6a778d0cdafd1dd60c0518e29f739c07d2f0 /.emacs.d/site-lisp/jabber-init.el
parentaaa9e1a953d8db0e974db9b09b2fe0b19751e3d9 (diff)
downloademacs-6d0999e20907345314d8fe8e1c42eb87a7f5ae63.tar.gz
emacs-6d0999e20907345314d8fe8e1c42eb87a7f5ae63.zip
Move jabber config to separate file
Diffstat (limited to '.emacs.d/site-lisp/jabber-init.el')
-rw-r--r--.emacs.d/site-lisp/jabber-init.el69
1 files changed, 69 insertions, 0 deletions
diff --git a/.emacs.d/site-lisp/jabber-init.el b/.emacs.d/site-lisp/jabber-init.el
new file mode 100644
index 0000000..76a57b0
--- /dev/null
+++ b/.emacs.d/site-lisp/jabber-init.el
@@ -0,0 +1,69 @@
+;;; jabber-initel --- Jabber.el initialization
+;;; Commentary:
+;;; Code:
+
+(require 'init (locate-user-emacs-file "init.elc" "init.el"))
+(require 'jabber)
+
+(autoload 'jabber-message-libnotify "jabber-libnotify")
+(autoload 'jabber-muc-libnotify "jabber-libnotify")
+
+(defun jabber-init-roster-mode-func ()
+ "Function for `jabber-roster-mode-hook'."
+ (setq mode-line-format
+ (list (propertize " %m" 'face 'mode-line-buffer-id))))
+
+(defun jabber-init-show-status-in-buffer (who oldstatus newstatus
+ statustext proposed-alert)
+ "Check to see if WHO has a buffer and if so print his new status.
+
+OLDSTATUS, NEWSTATUS and STATUSTEXT are ignored.
+
+Insert PROPOSED-ALERT in the buffer if it is non-nil."
+ (let ((buffer (get-buffer (jabber-chat-get-buffer who))))
+ (when (and buffer proposed-alert)
+ (with-current-buffer buffer
+ (insert proposed-alert "\n")))))
+
+(setq jabber-account-list
+ (mapcar (lambda (str) (list (concat str "/" (hostname))))
+ '("tom@ryuslash.org" "ryuslash@ninthfloor.org"))
+
+ jabber-avatar-cache-directory "~/.emacs.d/jabber-avatars/"
+ jabber-chat-buffer-format "+%n"
+ jabber-chat-foreign-prompt-format "%t %u/%r <\n"
+ jabber-chat-local-prompt-format "%t %u/%r >\n"
+ jabber-chat-buffer-show-avatar nil
+
+ jabber-chatstates-confirm nil
+
+ jabber-muc-colorize-local t
+ jabber-muc-colorize-foreign t
+
+ jabber-history-enabled t
+ jabber-use-global-history nil
+ jabber-history-dir "~/.emacs.d/jabber-hist"
+
+ jabber-groupchat-buffer-format "++%n"
+ jabber-groupchat-prompt-format "%t %u --\n"
+ jabber-muc-autojoin '("aethon@muc.ryuslash.org")
+
+ jabber-roster-show-bindings nil
+ jabber-show-offline-contacts nil
+
+ jabber-vcard-avatars-publish nil
+ jabber-vcard-avatars-retrieve nil)
+
+(add-hook 'jabber-alert-message-hooks #'jabber-message-libnotify)
+(add-hook 'jabber-alert-muc-hooks #'jabber-muc-libnotify)
+(add-hook 'jabber-chat-mode-hook #'visual-line-mode)
+(add-hook 'jabber-roster-mode-hook #'jabber-init-roster-mode-func)
+(add-hook 'jabber-alert-presence-hooks
+ #'jabber-init-show-status-in-buffer)
+
+(remove-hook 'jabber-alert-presence-hooks #'jabber-presence-echo)
+
+(global-set-key (kbd "<f6>") 'jabber-switch-to-roster-buffer)
+
+(provide 'jabber-init)
+;;; jabber-init.el ends here