[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'.
- [nongnu] elpa/hyperdrive 7d3662f842 25/82: Comment: Add TODO, (continued)
- [nongnu] elpa/hyperdrive 7d3662f842 25/82: Comment: Add TODO, ELPA Syncer, 2023/09/25
- [nongnu] elpa/hyperdrive 016582b1a2 26/82: Tidy: (--org-insert-link-after-advice) Bind search-option at top, ELPA Syncer, 2023/09/25
- [nongnu] elpa/hyperdrive 96129bb5db 27/82: Tidy: Whitespace, ELPA Syncer, 2023/09/25
- [nongnu] elpa/hyperdrive 80ec05b3b5 28/82: Add: (--org-normalize-link) Gut --org-insert-link-after-advice, ELPA Syncer, 2023/09/25
- [nongnu] elpa/hyperdrive 89fa2fe4a9 30/82: Tidy: (hyperdrive--org-normalize-link) Deduplicate full URL codepath, ELPA Syncer, 2023/09/25
- [nongnu] elpa/hyperdrive a4b2c538df 31/82: Tidy: (hyperdrive--org-normalize-link) Use if instead of cond, ELPA Syncer, 2023/09/25
- [nongnu] elpa/hyperdrive 36a18f326e 34/82: Change: (--org-normalize-link) Return early with search option, ELPA Syncer, 2023/09/25
- [nongnu] elpa/hyperdrive 91c3478593 36/82: Change: (hyperdrive--org-normalize-link) Use file-name-directory, ELPA Syncer, 2023/09/25
- [nongnu] elpa/hyperdrive c4567c4b9f 46/82: Change: (hyperdrive--org-normalize-link) Use hyperdrive-entry-url, ELPA Syncer, 2023/09/25
- [nongnu] elpa/hyperdrive 28151f3db9 39/82: Change: (--org-normalize-link) Split adaptive into absolute/relative, ELPA Syncer, 2023/09/25
- [nongnu] elpa/hyperdrive 25af84f5e4 52/82: Change: (hyperdrive--org-link) Add "::" to stored link,
ELPA Syncer <=
- [nongnu] elpa/hyperdrive 032a77ea2d 43/82: Test: -org-link/same-drive-different-path with heading, ELPA Syncer, 2023/09/25
- [nongnu] elpa/hyperdrive c99013b23a 61/82: Comment: Add outline heading, ELPA Syncer, 2023/09/25
- [nongnu] elpa/hyperdrive 2c3bc705c7 56/82: Test: Add hyperdrive-test-org-store-link-deftest macro, ELPA Syncer, 2023/09/25
- [nongnu] elpa/hyperdrive 46e6a1201f 54/82: Comment: Add TODO, ELPA Syncer, 2023/09/25
- [nongnu] elpa/hyperdrive 68e55a0ab6 55/82: Test: Add hyperdrive-test-org-store-link-scenarios, ELPA Syncer, 2023/09/25
- [nongnu] elpa/hyperdrive 6c203e3e34 58/82: Test: Test inserting links, ELPA Syncer, 2023/09/25
- [nongnu] elpa/hyperdrive 0d92314c4f 65/82: Docs: Document new advised org-insert-link behavior, ELPA Syncer, 2023/09/25
- [nongnu] elpa/hyperdrive 834c4a8908 63/82: Change: Rename test-hyperdrive-org.el, ELPA Syncer, 2023/09/25
- [nongnu] elpa/hyperdrive 658164484b 68/82: Tidy: (hyperdrive-test-org-entry-create) Don't bind org-stored-links, ELPA Syncer, 2023/09/25
- [nongnu] elpa/hyperdrive 373d55c1d8 73/82: Comment: Add TODO, ELPA Syncer, 2023/09/25