summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorRĂ¼diger Sonderfeld <ruediger@c-plusplus.de>2011-05-01 00:16:25 +0200
committerJulien Danjou <julien@danjou.info>2011-06-14 16:23:35 +0200
commitdf1ad057da991a209cbf6ff32cef4c4ebfe86a8d (patch)
treef9a369374b78737d915c343c27b8af589e889746 /contrib
parent7cb76203411f72f6595fd56b97c3fe63ff6c4b2c (diff)
org-contacts: added org-contacts-show-map (requires google-maps-el)
Signed-off-by: Julien Danjou <julien@danjou.info>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/lisp/org-contacts.el18
1 files changed, 18 insertions, 0 deletions
diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index c07c25ec4..63ba00520 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/org-contacts.el
@@ -54,6 +54,11 @@ If set to nil, all your Org files will be used."
:type 'string
:group 'org-contacts)
+(defcustom org-contacts-address-property "ADDRESS"
+ "Name of the property for contact address."
+ :type 'string
+ :group 'org-contacts)
+
(defcustom org-contacts-birthday-property "BIRTHDAY"
"Name of the property for contact birthday date."
:type 'string
@@ -594,4 +599,17 @@ Org-contacts does not specify how to encode the name. So we try to do our best."
(current-buffer)
(progn (save-buffer) (kill-buffer)))))
+(defun org-contacts-show-map (&optional name)
+ "Show contacts on a map. Requires google-maps-el."
+ (interactive)
+ (unless (fboundp 'google-maps-static-show)
+ (error "org-contacts-show-map requires google-maps-el."))
+ (google-maps-static-show
+ :markers
+ (loop
+ for contact in (org-contacts-filter name)
+ for addr = (cdr (assoc-string org-contacts-address-property (caddr contact)))
+ if addr
+ collect (cons (list addr) (list :label (string-to-char (car contact)))))))
+
(provide 'org-contacts)