[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ;;; anything.el --- open anything
From: |
Mathias Dahl |
Subject: |
Re: ;;; anything.el --- open anything |
Date: |
Fri, 29 Jun 2007 09:32:18 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1 (windows-nt) |
Mathias Dahl <address@hidden> 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
- Re: ;;; anything.el --- open anything, (continued)
Re: ;;; anything.el --- open anything, Mathias Dahl, 2007/06/25
- Re: ;;; anything.el --- open anything, address@hidden, 2007/06/25
- Re: ;;; anything.el --- open anything, address@hidden, 2007/06/25
- Re: ;;; anything.el --- open anything, Mathias Dahl, 2007/06/27
- Re: ;;; anything.el --- open anything, address@hidden, 2007/06/27
- Re: ;;; anything.el --- open anything, Mathias Dahl, 2007/06/28
- Re: ;;; anything.el --- open anything, address@hidden, 2007/06/28
Re: ;;; anything.el --- open anything,
Mathias Dahl <=