branch: elpa/hyperdrive
commit afb04553fcf096aebc8a35598532aeb984827f0d
Author: Joseph Turner <[email protected]>
Commit: Joseph Turner <[email protected]>

    Tidy: Split h/org--element-entry out from h/org--link-entry-at-point
    
    This allows h/org--element-entry to be called with an Org link element
    context which has been previously extracted, as with org-transclusion.el.
---
 hyperdrive-org.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/hyperdrive-org.el b/hyperdrive-org.el
index fa101e31b4..3ca0327387 100644
--- a/hyperdrive-org.el
+++ b/hyperdrive-org.el
@@ -129,8 +129,13 @@ the logic for handling links of \"file\" type."
   "Return a hyperdrive entry for the Org link at point."
   ;; This function is not in the code path for full URLs or links that
   ;; are only search options.
-  (let* ((context (org-element-lineage (org-element-context) '(link) t))
-         (element-type (org-element-type context))
+  (h/org--element-entry
+   (org-element-lineage (org-element-context) '(link) t)))
+
+(defun h/org--element-entry (context)
+  "Return the hyperdrive entry for the Org CONTEXT.
+If CONTEXT does not correspond to a hyperdrive entry, return nil."
+  (let* ((element-type (org-element-type context))
          (link-type (org-element-property :type context))
          (raw-link-type (org-element-property :raw-link context)))
     (and (eq element-type 'link)

Reply via email to