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

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

[nongnu] elpa/hyperdrive 25af84f5e4 52/82: Change: (hyperdrive--org-link


From: ELPA Syncer
Subject: [nongnu] elpa/hyperdrive 25af84f5e4 52/82: Change: (hyperdrive--org-link) Add "::" to stored link
Date: Mon, 25 Sep 2023 19:00:54 -0400 (EDT)

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

    Change: (hyperdrive--org-link) Add "::" to stored link
    
    Instead of adding "::" to the fragment when inserting a link, add it
    when storing the link, then remove it when linking by search option alone.
---
 hyperdrive-org.el | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/hyperdrive-org.el b/hyperdrive-org.el
index 8c3389b701..b58a58464a 100644
--- a/hyperdrive-org.el
+++ b/hyperdrive-org.el
@@ -94,8 +94,8 @@ raw URL, not an Org link."
   (when hyperdrive-mode
     (let* ((heading (org-entry-get (point) "ITEM"))
            (custom-id (org-entry-get (point) "CUSTOM_ID"))
-           (fragment (cond (custom-id (concat "#" custom-id))
-                           (heading (concat "*" heading))))
+           (fragment (cond (custom-id (concat "::#" custom-id))
+                           (heading (concat "::*" heading))))
            (entry-copy (hyperdrive-copy-tree hyperdrive-current-entry t))
            (_ (setf (alist-get 'target (hyperdrive-entry-etc entry-copy)) 
fragment))
            (raw-url (hyperdrive-entry-url entry-copy)))
@@ -184,12 +184,9 @@ FIXME: Docstring, maybe move details from 
`hyperdrive-org-link-full-url'."
   (let ((search-option (alist-get 'target (hyperdrive-entry-etc entry))))
     (when (and search-option
                (hyperdrive-entry-equal-p hyperdrive-current-entry entry))
-      ;; Search option alone
-      (cl-return-from hyperdrive--org-shorthand-link search-option))
-
-    (when search-option
-      ;; When linking to a different file, prefix search option with "::".
-      (cl-callf2 concat "::" search-option))
+      ;; Search option alone: Remove leading "::"
+      (cl-return-from hyperdrive--org-shorthand-link
+        (substring search-option (length "::"))))
 
     (let ((adaptive-target-p
            ;; See the `adaptive' option in `org-link-file-path-type'.



reply via email to

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