Skip to content

Instantly share code, notes, and snippets.

@whysoserious
Created June 4, 2014 09:54
Show Gist options
  • Save whysoserious/d21e9377174373ecc0aa to your computer and use it in GitHub Desktop.
Save whysoserious/d21e9377174373ecc0aa to your computer and use it in GitHub Desktop.
jabber in emacs
(require 'jabber)
(setq jabber-account-list
'(("pan@gmail.com"
(:network-server . "talk.google.com")
(:connection-type . ssl)
(:port . 5223)
(:password . "xxxxxxxxxxxxxxxxcipa"))))
(setq
jabber-history-enabled t
jabber-use-global-history nil
jabber-backlog-number 40
jabber-backlog-days 30
)
(setq jabber-alert-presence-message-function (lambda (who oldstatus newstatus statustext) nil))
(define-key jabber-chat-mode-map (kbd "RET") 'newline)
(define-key jabber-chat-mode-map [C-return] 'jabber-chat-buffer-send)
(add-hook 'jabber-chat-mode-hook 'goto-address)
(define-jabber-alert echo "Show a message in the echo area"
(lambda (msg)
(unless (minibuffer-prompt)
(message "%s" msg))))
(defun jabber-visit-history (jid)
"Visit jabber history with JID in a new buffer.
Performs well only for small files. Expect to wait a few seconds
for large histories. Adapted from `jabber-chat-create-buffer'."
(interactive (list (jabber-read-jid-completing "JID: ")))
(let ((buffer (generate-new-buffer (format "*-jabber-history-%s-*"
(jabber-jid-displayname jid)))))
(switch-to-buffer buffer)
(make-local-variable 'jabber-chat-ewoc)
(setq jabber-chat-ewoc (ewoc-create #'jabber-chat-pp))
(mapc 'jabber-chat-insert-backlog-entry
(nreverse (jabber-history-query nil nil t t "."
(jabber-history-filename jid))))
(view-mode)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment