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

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

[elpa] externals/org-contacts 3f62975e74 1/3: Handle property "EMAIL" va


From: ELPA Syncer
Subject: [elpa] externals/org-contacts 3f62975e74 1/3: Handle property "EMAIL" value in some cases:
Date: Mon, 10 Jul 2023 09:59:31 -0400 (EDT)

branch: externals/org-contacts
commit 3f62975e742154f261c6465be74b27be1f3df72e
Author: stardiviner <numbchild@gmail.com>
Commit: stardiviner <numbchild@gmail.com>

    Handle property "EMAIL" value in some cases:
    
    - `mailto:` link
    - multiple emails, multiple `mailto:` links
    
    e.g. "[[mailto:yantar92@posteo.net]]";, 
"[[mailto:yantar92@posteo.net][yantar92@posteo.net]]";
---
 org-contacts.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/org-contacts.el b/org-contacts.el
index ca40b84f96..d6bccbe9d8 100644
--- a/org-contacts.el
+++ b/org-contacts.el
@@ -1372,7 +1372,14 @@ Each element has the form (NAME . (FILE . POSITION))."
                      (with-current-buffer org-contacts-buffer
                        (goto-char position)
                        ;; (symbol-name (org-property-or-variable-value 'EMAIL))
-                       (org-entry-get (point) "EMAIL")))))
+                       (when-let ((pvalue (org-entry-get (point) "EMAIL")))
+                         ;; handle `mailto:' link. e.g. 
"[[mailto:yantar92@posteo.net]]";, 
"[[mailto:yantar92@posteo.net][yantar92@posteo.net]]";
+                         ;; Reference the testing file `test-org-contacts.el'.
+                         (if (string-match
+                              "\\[\\[mailto:\\(.*\\)\\]\\(\\[.*\\]\\)\\]\\(,\\ 
*\\[\\[mailto:\\(.*\\)\\]\\(\\[.*\\]\\)\\]\\)"
+                              pvalue)
+                             (match-string 1 pvalue)
+                           pvalue))))))
        (ignore name)
        ;; (cons name email)
        email))



reply via email to

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