On Thu, Jun 5, 2014 at 7:50 AM, Daimrod <[email protected]> wrote:
> org-contacts-complete-group
Here is a better function I think. It uses the builtin org-contacts
database:
(defun insert-emails-from-tags (tag-expression)
"insert emails from org-contacts that match the tags expression. For
example:
group-phd will match entries tagged with group but not with phd."
(interactive "sTags: ")
(insert
(mapconcat 'identity
(loop for contact in (org-contacts-filter)
for contact-name = (car contact)
for email = (org-contacts-strip-link (car
(org-contacts-split-property
(or
(cdr (assoc-string
org-contacts-email-property
(caddr contact)))
""))))
for tags = (cdr (assoc "TAGS" (nth 2 contact)))
for tags-list = (if tags
(split-string (substring (cdr (assoc "TAGS" (nth 2
contact))) 1 -1) ":")
'())
if (let ((todo-only nil))
(eval (cdr (org-make-tags-matcher tag-expression))))
collect (org-contacts-format-email contact-name email))
",")))
John
-----------------------------------
John Kitchin
Associate Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu