emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] scratch/org-contacts-rebased e585be0 009/118: org-contacts: added


From: Stefan Monnier
Subject: [elpa] scratch/org-contacts-rebased e585be0 009/118: org-contacts: added org-contacts-show-map (requires google-maps-el)
Date: Fri, 12 Nov 2021 15:36:54 -0500 (EST)

branch: scratch/org-contacts-rebased
commit e585be0859529b7f479168f0bd94060e11e7211a
Author: RĂ¼diger Sonderfeld <ruediger@c-plusplus.de>
Commit: Julien Danjou <julien@danjou.info>

    org-contacts: added org-contacts-show-map (requires google-maps-el)
    
    Signed-off-by: Julien Danjou <julien@danjou.info>
---
 org-contacts.el | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/org-contacts.el b/org-contacts.el
index c07c25e..63ba005 100644
--- a/org-contacts.el
+++ b/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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]