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

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

[elpa] externals/org eb3de47: Merge branch 'maint'


From: ELPA Syncer
Subject: [elpa] externals/org eb3de47: Merge branch 'maint'
Date: Thu, 6 May 2021 08:57:12 -0400 (EDT)

branch: externals/org
commit eb3de47d255b49832ed43ff10e813766e0fb1015
Merge: f95a5cb b4b35fc
Author: Bastien <bzg@gnu.org>
Commit: Bastien <bzg@gnu.org>

    Merge branch 'maint'
---
 lisp/ol.el | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/lisp/ol.el b/lisp/ol.el
index 617223c..aaa98b7 100644
--- a/lisp/ol.el
+++ b/lisp/ol.el
@@ -1598,9 +1598,8 @@ non-nil."
 
        ((and (buffer-file-name (buffer-base-buffer)) (derived-mode-p 
'org-mode))
        (org-with-limited-levels
-        (setq custom-id (org-entry-get nil "CUSTOM_ID"))
-        (cond
-         ;; Store a link using the target at point
+         (cond
+         ;; Store a link using the target at point.
          ((org-in-regexp "[^<]<<\\([^<>]+\\)>>[^>]" 1)
           (setq cpltxt
                 (concat "file:"
@@ -1608,6 +1607,15 @@ non-nil."
                          (buffer-file-name (buffer-base-buffer)))
                         "::" (match-string 1))
                 link cpltxt))
+          ;; Store a link using the CUSTOM_ID property.
+          ((setq custom-id (org-entry-get nil "CUSTOM_ID"))
+           (setq cpltxt
+                (concat "file:"
+                        (abbreviate-file-name
+                         (buffer-file-name (buffer-base-buffer)))
+                        "::#" custom-id)
+                link cpltxt))
+          ;; Store a link using (and perhaps creating) the ID property.
          ((and (featurep 'org-id)
                (or (eq org-id-link-to-org-use-id t)
                    (and interactive?
@@ -1616,14 +1624,13 @@ non-nil."
                                      'create-if-interactive-and-no-custom-id)
                                  (not custom-id))))
                    (and org-id-link-to-org-use-id (org-entry-get nil "ID"))))
-          ;; Store a link using the ID at point
           (setq link (condition-case nil
                          (prog1 (org-id-store-link)
                            (setq desc (or (plist-get org-store-link-plist
                                                      :description)
                                           "")))
                        (error
-                        ;; Probably before first headline, link only to file
+                        ;; Probably before first headline, link only to file.
                         (concat "file:"
                                 (abbreviate-file-name
                                  (buffer-file-name (buffer-base-buffer))))))))



reply via email to

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