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

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

[elpa] scratch/org-contacts-rebased 79d7a88 096/118: org-contacts.el: Ad


From: Stefan Monnier
Subject: [elpa] scratch/org-contacts-rebased 79d7a88 096/118: org-contacts.el: Add support for org-id generated link.
Date: Fri, 12 Nov 2021 15:37:11 -0500 (EST)

branch: scratch/org-contacts-rebased
commit 79d7a885d9746234e12e560b2aacbd3c19d4ed8b
Author: stardiviner <numbchild@gmail.com>
Commit: stardiviner <numbchild@gmail.com>

    org-contacts.el: Add support for org-id generated link.
    
    * contrib/lisp/org-contacts.el (org-contacts-link-store): Use org-id
    store link if org-id-link-to-org-use-id is t.
---
 org-contacts.el | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/org-contacts.el b/org-contacts.el
index 44ba455..fa62cd8 100644
--- a/org-contacts.el
+++ b/org-contacts.el
@@ -1159,11 +1159,13 @@ are effectively trimmed).  If nil, all zero-length 
substrings are retained."
   "Store the contact in `org-contacts-files' with a link."
   (when (and (eq major-mode 'org-mode)
             (member (buffer-file-name) (mapcar 'expand-file-name 
org-contacts-files)))
-    (let ((headline-str (substring-no-properties (org-get-heading t t t t))))
-      (org-store-link-props
-       :type "org-contact"
-       :link headline-str
-       :description headline-str))))
+    (if org-id-link-to-org-use-id
+       (org-id-store-link)
+      (let ((headline-str (substring-no-properties (org-get-heading t t t t))))
+       (org-store-link-props
+        :type "org-contact"
+        :link headline-str
+        :description headline-str)))))
 
 (defun org-contacts--all-contacts ()
   "Return an alist (name . (file . position)) of all contacts in 
`org-contacts-files'."



reply via email to

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