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

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

[nongnu] elpa/hyperdrive 360c7d860f 49/82: Add: (hyperdrive--org-link-de


From: ELPA Syncer
Subject: [nongnu] elpa/hyperdrive 360c7d860f 49/82: Add: (hyperdrive--org-link-description) Utility function
Date: Mon, 25 Sep 2023 19:00:53 -0400 (EDT)

branch: elpa/hyperdrive
commit 360c7d860fb8f2f5f7d92d70e380eb4c093693c8
Author: Joseph Turner <joseph@ushin.org>
Commit: Joseph Turner <joseph@ushin.org>

    Add: (hyperdrive--org-link-description) Utility function
---
 hyperdrive-org.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/hyperdrive-org.el b/hyperdrive-org.el
index e5fd0bcd6f..2010b7b07e 100644
--- a/hyperdrive-org.el
+++ b/hyperdrive-org.el
@@ -222,6 +222,13 @@ FIXME: Docstring, maybe move details from 
`hyperdrive-org-link-full-url'."
             (file-name-directory (hyperdrive-entry-path 
hyperdrive-current-entry)))))
         search-option)))))
 
+(defun hyperdrive--org-link-description (link)
+  "Return description of Org LINK or nil if it has none."
+  ;; TODO: Is there a built-in solution?
+  (when-let* ((desc-begin (org-element-property :contents-begin link))
+              (desc-end (org-element-property :contents-end link)))
+    (buffer-substring desc-begin desc-end)))
+
 ;;;###autoload
 (with-eval-after-load 'org
   (org-link-set-parameters "hyper"



reply via email to

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