John Kitchin <jkitc...@andrew.cmu.edu> writes: > neat idea. This code does exactly what I need for the completion for a > whole tag query. It should be possible to integrate that into > completion. > > (defun insert-emails-from-tags (tags) > (interactive "sTags: ") > (insert > (save-window-excursion > (find-file "contacts-bbdb.org") > (mapconcat > 'identity > (let ((todo-only nil)) > (org-scan-tags > (lambda () > (org-entry-get (point) "EMAIL")) ; action > (cdr (org-make-tags-matcher tags)) ; matcher > nil)) ", ")))) > > It should be possible to integrate this into the org-contacts database > to get this with completion. I will look into this later today. Thanks > for the ideas.
The completion for group based on tags is done in the function `org-contacts-complete-group'. It's been a long time since I played with the completion mechanism, so I don't remember exactly how it worked. Maybe you can replace the mapcar with your function, but it might a bit more tricky than that, especially to handle empty result. Thanks for your work :) Best, -- Daimrod/Greg