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

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

[nongnu] elpa/hyperdrive c1932fb6fd 74/82: Change: (hyperdrive--org-open


From: ELPA Syncer
Subject: [nongnu] elpa/hyperdrive c1932fb6fd 74/82: Change: (hyperdrive--org-open-at-point) Include target
Date: Mon, 25 Sep 2023 19:00:56 -0400 (EDT)

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

    Change: (hyperdrive--org-open-at-point) Include target
    
    Also, use expand-file-name instead of hyperdrive-expand-url.
---
 hyperdrive-lib.el | 9 ---------
 hyperdrive-org.el | 8 +++++++-
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/hyperdrive-lib.el b/hyperdrive-lib.el
index ed69d98b8a..b033121056 100644
--- a/hyperdrive-lib.el
+++ b/hyperdrive-lib.el
@@ -1387,15 +1387,6 @@ When PATH is nil or blank, return \"/\"."
                         path)
                       "/")))
 
-(defun hyperdrive-expand-url (path &optional base)
-  "Return a URL string of PATH expanded against current entry.
-When BASE is non-nil, PATH will be expanded against BASE instead."
-  (let* ((urlobj (url-generic-parse-url path))
-         (defobj (url-generic-parse-url (or base (hyperdrive-entry-url 
hyperdrive-current-entry)))))
-    ;; Destructively modify the URL object to give it the correct host and 
path.
-    (url-default-expander urlobj defobj)
-    (url-recreate-url urlobj)))
-
 ;;;; Utilities
 
 (defun hyperdrive-time-greater-p (a b)
diff --git a/hyperdrive-org.el b/hyperdrive-org.el
index 47dff61750..b558b18202 100644
--- a/hyperdrive-org.el
+++ b/hyperdrive-org.el
@@ -146,7 +146,13 @@ the current location."
                  ;; Don't treat link as a relative/absolute path in the
                  ;; hyperdrive if "file:" protocol prefix is explicit.
                  (not (string-prefix-p "file:" raw-link-type)))
-        (hyperdrive-open-url (hyperdrive-expand-url (org-element-property 
:path context)))))))
+        (pcase-let* (((cl-struct hyperdrive-entry hyperdrive path) 
hyperdrive-current-entry)
+                     (entry (hyperdrive-entry-create
+                             :hyperdrive (hyperdrive-entry-hyperdrive 
hyperdrive-current-entry)
+                             :path (expand-file-name (org-element-property 
:path context)
+                                                     (file-name-directory 
path))
+                             :etc `((target . ,(org-element-property 
:search-option context))))))
+          (hyperdrive-open entry))))))
 
 (defun hyperdrive--org-insert-link-after-advice (&rest _)
   "Modify just-inserted link as appropriate for `hyperdrive-mode' buffers."



reply via email to

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