-
Notifications
You must be signed in to change notification settings - Fork 2
/
my-jabber-config.el
92 lines (82 loc) · 3.54 KB
/
my-jabber-config.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
;;;; jabber.el -*- coding: utf-8 -*-
(when siscog-p
(setenv "PATH" (format "d:\\cygwin\\bin;d:\\cygwin\\usr\\bin;%s"
(getenv "PATH"))))
(let ((emacs-jabber-dir "~/.emacs.d/emacs-jabber/"))
(when (file-exists-p emacs-jabber-dir)
(add-to-list 'load-path emacs-jabber-dir)
(require 'jabber-autoloads)))
(eval-after-load 'jabber
`(progn
;; Faces
(set-face-foreground 'jabber-chat-prompt-local "OrangeRed4")
(cond (siscog-p
(set-face-foreground 'jabber-chat-text-local "OrangeRed4")
(set-face-foreground 'jabber-chat-prompt-foreign "OrangeRed3")
(set-face-foreground 'jabber-chat-text-foreign "OrangeRed3"))
(t
(set-face-foreground 'jabber-chat-text-local "OrangeRed1")
(set-face-foreground 'jabber-chat-prompt-foreign "orange1")))
(set-face-foreground 'jabber-roster-user-online "LimeGreen")
(set-face-foreground 'jabber-roster-user-away "YellowGreen")
(set-face-foreground 'jabber-roster-user-dnd "IndianRed")
(set-face-foreground 'jabber-activity-face "yellow4")
(set-face-foreground 'jabber-activity-personal-face "yellow4")
(set-face-attribute 'jabber-title-medium nil
:width 'unspecified :height 'unspecified)
;; Roster Options
(setq jabber-vcard-avatars-retrieve nil)
(setq jabber-roster-show-title nil)
(setq jabber-roster-show-bindings nil)
(setq jabber-show-offline-contacts nil)
(setq jabber-show-resources nil)
(setq jabber-sort-order nil)
;; Chat Options
(add-hook 'jabber-roster-mode-hook (lambda () (setq truncate-lines t)))
(setq jabber-chat-local-prompt-format "[%t] Luís> ")
(add-hook 'jabber-chat-mode-hook
(lambda ()
(visual-line-mode t)
(set-input-method 'portuguese-prefix)))
;; Misc Options
(setq jabber-auto-reconnect t)
(setq jabber-default-status "SISCOG")
(setq jabber-default-show "dnd")
(setq jabber-alert-presence-hooks nil)
(setq jabber-alert-message-hooks '(jabber-message-scroll))
(setq jabber-activity-count-in-title t)))
(defun lbo:read-file (path)
(with-temp-buffer
(insert-file-contents path)
(buffer-string)))
(defun gtalk ()
(interactive)
(let ((jabber-account-list
`(("[email protected]"
(:password . ,(when siscog-p (lbo:read-file "w:/.jabber-password")))
(:network-server . "talk.google.com")
(:port . 443)
(:connection-type . ssl)))))
(jabber-connect-all)))
(global-set-key (kbd "C-x C-j C-c") 'gtalk)
(defun sc-jabber ()
(interactive)
(let ((jabber-account-list
`(("luismbo"
(:password . ,sc-pass)
(:network-server . "SRVCUPS-Pub.siscog")
(:port . 5222)
(:connection-type . ssl)))))
(jabber-connect-all)))
;; (when siscog-p
;; (global-set-key (kbd "C-z")
;; (defun my-minimize-window ()
;; (interactive)
;; (switch-to-buffer "*scratch*")
;; (suspend-frame))))
(defun gtalk-groupchat ()
(interactive)
(let ((group (apply 'format "private-chat-%x%x%x%x%x%x%x%x-%x%x%x%x-%x%x%x%x-%x%x%x%x-%x%x%x%x%x%x%x%x%x%x%x%[email protected]"
(mapcar (lambda (x) (random x)) (make-list 32 15))))
(account (jabber-read-account)))
(jabber-groupchat-join account group (jabber-muc-read-my-nickname account group) t)))