Mathias Dahl <[EMAIL PROTECTED]> writes:
> I might also try to extend it to find my Jabber buddies and start
> chatting with them.
Did it. Works. The code below requires jabber.el:
(defun my-jabber-list-contacts (&optional subset require-match default
resource)
"List Jabber contacts.
This is a blatant copy-paste from `jabber-chat-with' with some
code removed."
(let ((jid-at-point (or
(and default
;; default can be either a symbol or a string
(if (symbolp default)
(symbol-name default)
default))
(get-text-property (point) 'jabber-jid)
(bound-and-true-p jabber-chatting-with)
(bound-and-true-p jabber-group)))
(completion-ignore-case t)
(jid-completion-table (mapcar #'(lambda (item)
(cons (symbol-name item) item))
(or subset (jabber-concat-rosters))))
chosen)
(dolist (item (or subset (jabber-concat-rosters)))
(if (get item 'name)
(push (cons (get item 'name) item) jid-completion-table)))
;; if the default is not in the allowed subset, it's not a good default
(if (and subset (not (assoc jid-at-point jid-completion-table)))
(setq jid-at-point nil))
jid-completion-table))
To be more useful the above should probably only list online contacts.
Add this to your anything sources:
...
((name . "Jabber Contacts")
(candidates . (lambda ()
(mapcar
(lambda (x)
(car x))
(my-jabber-list-contacts))))
(action . (lambda (x)
(jabber-chat-with
(jabber-read-account)
x))))
...
/Mathias
_______________________________________________
gnu-emacs-sources mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources