[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/hyperdrive 2678c1d7ca 064/102: Change: Replace hyperdrive-
|
From: |
ELPA Syncer |
|
Subject: |
[nongnu] elpa/hyperdrive 2678c1d7ca 064/102: Change: Replace hyperdrive--org- prefix with hyperdrive-org-- |
|
Date: |
Wed, 29 Nov 2023 04:00:54 -0500 (EST) |
branch: elpa/hyperdrive
commit 2678c1d7ca025dbfe83ae7797ed26aca3bef281b
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Change: Replace hyperdrive--org- prefix with hyperdrive-org--
A few symbols already used the latter prefix and there was a TODO
item about having to decide which prefix should be used. Since we
are also going to use shorthands, it IMO makes more sense to use the
latter prefix. The "ho-" shorthand prefix makes more sense if the
two affected prefixes are "hyperdrive-org-" and "hyperdrive-org--".
---
hyperdrive-org.el | 28 +++++++++++++---------------
tests/test-hyperdrive-markdown.el | 2 +-
tests/test-hyperdrive-org.el | 6 +++---
3 files changed, 17 insertions(+), 19 deletions(-)
diff --git a/hyperdrive-org.el b/hyperdrive-org.el
index dcf3130c69..63725b4245 100644
--- a/hyperdrive-org.el
+++ b/hyperdrive-org.el
@@ -59,7 +59,7 @@ which see."
(when hyperdrive-current-entry
(pcase-let (((map type link description)
(pcase major-mode
- ('org-mode (hyperdrive--org-link))
+ ('org-mode (hyperdrive-org--link))
('hyperdrive-dir-mode
(let ((entry (hyperdrive-dir--entry-at-point)))
`((type . "hyper://")
@@ -71,7 +71,7 @@ which see."
(org-link-store-props :type type :link link :description description)
t)))
-(defun hyperdrive--org-link (&optional raw-url-p)
+(defun hyperdrive-org--link (&optional raw-url-p)
"Return Org alist for current Org buffer.
Attempts to link to the entry at point. If RAW-URL-P, return a
raw URL, not an Org link."
@@ -114,7 +114,7 @@ raw URL, not an Org link."
;; have been configured with `org-link-set-parameters'.
(hyperdrive-open (hyperdrive-url-entry (concat "hyper:" url))))
-(defun hyperdrive--org-link-goto (target)
+(defun hyperdrive-org--link-goto (target)
"Go to TARGET in current Org buffer.
TARGET may be a CUSTOM_ID or a headline."
(cl-assert (eq 'org-mode major-mode))
@@ -125,17 +125,15 @@ TARGET may be a CUSTOM_ID or a headline."
;; TODO: Support other hyper:// links like diffs when implemented.
(hyperdrive-entry-url (hyperdrive-read-entry :read-version t)))
-;; TODO: hyperdrive--org-* or hyperdrive-org--*?
-
-(defun hyperdrive--org-open-at-point ()
+(defun hyperdrive-org--open-at-point ()
"Handle relative links in hyperdrive-mode org files.
Added to `org-open-at-point-functions' in order to short-circuit
the logic for handling links of \"file\" type."
(when hyperdrive-mode
- (hyperdrive-open (hyperdrive--org-link-entry-at-point))))
+ (hyperdrive-open (hyperdrive-org--link-entry-at-point))))
-(defun hyperdrive--org-link-entry-at-point ()
+(defun hyperdrive-org--link-entry-at-point ()
"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.
@@ -156,13 +154,13 @@ the logic for handling links of \"file\" type."
:etc `((target . ,(org-element-property
:search-option context))))))
entry))))
-(defun hyperdrive--org-insert-link-after-advice (&rest _)
+(defun hyperdrive-org--insert-link-after-advice (&rest _)
"Modify just-inserted link as appropriate for `hyperdrive-mode' buffers."
(when (and hyperdrive-mode hyperdrive-current-entry)
(let* ((link-element (org-element-context))
(_ (cl-assert (eq 'link (car link-element))))
(url (org-element-property :raw-link link-element))
- (desc (hyperdrive--org-link-description link-element))
+ (desc (hyperdrive-org--link-description link-element))
(target-entry (hyperdrive-url-entry url)))
(when (and (not hyperdrive-org-link-full-url)
(hyperdrive-entry-hyperdrive-equal-p
@@ -170,10 +168,10 @@ the logic for handling links of \"file\" type."
(delete-region (org-element-property :begin link-element)
(org-element-property :end link-element))
(insert (org-link-make-string
- (hyperdrive--org-shorthand-link target-entry)
+ (hyperdrive-org--shorthand-link target-entry)
desc))))))
-(cl-defun hyperdrive--org-shorthand-link (entry)
+(cl-defun hyperdrive-org--shorthand-link (entry)
"Return a non-\"hyper://\"-prefixed link to ENTRY.
Respects `hyperdrive-org-link-full-url' and `org-link-file-path-type'."
;; FIXME: Docstring, maybe move details from `hyperdrive-org-link-full-url'.
@@ -181,7 +179,7 @@ Respects `hyperdrive-org-link-full-url' and
`org-link-file-path-type'."
(let ((search-option (alist-get 'target (hyperdrive-entry-etc entry))))
(when (and search-option
(hyperdrive-entry-equal-p hyperdrive-current-entry entry))
- (cl-return-from hyperdrive--org-shorthand-link search-option))
+ (cl-return-from hyperdrive-org--shorthand-link search-option))
;; Search option alone: Remove leading "::"
(when search-option
@@ -210,7 +208,7 @@ Respects `hyperdrive-org-link-full-url' and
`org-link-file-path-type'."
(file-name-directory (hyperdrive-entry-path
hyperdrive-current-entry)))))
search-option)))))
-(defun hyperdrive--org-link-description (link)
+(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))
@@ -228,7 +226,7 @@ Respects `hyperdrive-org-link-full-url' and
`org-link-file-path-type'."
;; buffers as links to files within that hyperdrive. Only add
;; this function to the variable after `hyperdrive' is loaded so
;; that `hyperdrive-mode' will be defined.
- (cl-pushnew #'hyperdrive--org-open-at-point org-open-at-point-functions)))
+ (cl-pushnew #'hyperdrive-org--open-at-point org-open-at-point-functions)))
;;;; Footer
diff --git a/tests/test-hyperdrive-markdown.el
b/tests/test-hyperdrive-markdown.el
index 58eb08b575..49e6a075b6 100644
--- a/tests/test-hyperdrive-markdown.el
+++ b/tests/test-hyperdrive-markdown.el
@@ -40,7 +40,7 @@
;;;; Parse relative/absolute link into entry tests
;; Neither full "hyper://"-prefixed URLs, nor links which are only search
-;; options, are handled by `hyperdrive--org-link-entry-at-point'.
+;; options, are handled by `hyperdrive-org--link-entry-at-point'.
(defmacro hyperdrive-test-markdown-parse-link-deftest (name current-entry link
parsed-entry)
(declare (indent defun))
diff --git a/tests/test-hyperdrive-org.el b/tests/test-hyperdrive-org.el
index 1a8fd336bc..1772fa7d94 100644
--- a/tests/test-hyperdrive-org.el
+++ b/tests/test-hyperdrive-org.el
@@ -253,7 +253,7 @@ variables and the expected link."
;; Testing a different drive should stand in for testing
;; `hyperdrive-org-link-full-url' as well as insertion in
;; non-hyperdrive buffers, since all of these cases cause
-;; `hyperdrive--org-insert-link-after-advice' to do nothing.
+;; `hyperdrive-org--insert-link-after-advice' to do nothing.
(hyperdrive-test-org-insert-link-deftest
org-mode-before-heading/different-drive
:public-key "fredbeef"
@@ -274,7 +274,7 @@ variables and the expected link."
;;;; Parse relative/absolute link into entry tests
;; Neither full "hyper://"-prefixed URLs, nor links which are only search
-;; options, are handled by `hyperdrive--org-link-entry-at-point'.
+;; options, are handled by `hyperdrive-org--link-entry-at-point'.
(defmacro hyperdrive-org-test-link-parse-deftest (name current-entry link
parsed-entry)
(declare (indent defun))
@@ -288,7 +288,7 @@ variables and the expected link."
(insert ,link)
(goto-char (point-min))
(should
- (hyperdrive-entry-equal-p ,parsed-entry
(hyperdrive--org-link-entry-at-point))))))))
+ (hyperdrive-entry-equal-p ,parsed-entry
(hyperdrive-org--link-entry-at-point))))))))
(hyperdrive-org-test-link-parse-deftest absolute/without-search-option
(hyperdrive-entry-create
- [nongnu] elpa/hyperdrive 780bd3d8e0 004/102: Fix/Change: (-menu-hyperdrive) Use new display-only child syntax, (continued)
- [nongnu] elpa/hyperdrive 780bd3d8e0 004/102: Fix/Change: (-menu-hyperdrive) Use new display-only child syntax, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive 1f7dfa3580 039/102: Fix: (hyperdrive-mirror-set-target) Validate target path, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive f52b33cef4 057/102: Tidy: Docstring, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive ccaffb946d 021/102: Change: (hyperdrive-menu-hyperdrive) Remove adhoc mirror command, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive 78522efb2b 053/102: Change: (-history) Use --format-entry to generate buffer name, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive 4bc553f329 027/102: Fix: (hyperdrive-menu) Only show "Jump" in hyperdrive-dir-mode, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive 4a91fe1ac9 010/102: Change: (-menu-hyperdrive) Place trivial lambdas on single lines, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive f5a90f3fb2 031/102: Fix: (hyperdrive-menu) Require hyperdrive, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive 4277b29b50 023/102: Comment: Remove TODO, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive 227a839bf7 058/102: Comment: Remove TODO, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive 2678c1d7ca 064/102: Change: Replace hyperdrive--org- prefix with hyperdrive-org--,
ELPA Syncer <=
- [nongnu] elpa/hyperdrive 0b5102ac9c 036/102: Meta: Update CHANGELOG, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive d1b68b1a66 048/102: Add: (hyperdrive-entry-format-alist) Consolidate entry formats, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive cc0e3cdfdf 059/102: Tidy: Indentation, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive fa48b80132 060/102: Improve defcustom, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive 98761ce57f 007/102: Change: (-menu-hyperdrive) Move definitions of suffix descriptions, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive 807b1fd0df 051/102: Change: (hyperdrive--format-host) Remove :with-faces keyword argument, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive d19558893e 035/102: Fix: Require 'rx, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive 22c95b82a4 068/102: Fix: Complete rename of org link functions, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive 5883d33fca 099/102: Meta: Update changelog, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive e944a86276 077/102: Docs: Say "file" not "entry", ELPA Syncer, 2023/11/29