Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2025-10-26 Bob Weiner <[email protected]>

* hywiki.el (hywiki-publish-to-html): Rewrite to use standard Org html ids, not
HyWiki-specific ones.

* hpath.el (hpath:call): Fix conditional at end to handle empty string for 'expanded-path'.
This fixes handling of "#anchor" only references.
(hpath:find): Handle encoded file:// URLs.

2025-10-18 Bob Weiner <[email protected]>

* hypb.el (hypb:in-string-modes-regexps): Change to support Python delimiters in
Expand Down
16 changes: 13 additions & 3 deletions hpath.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 1-Nov-91 at 00:44:23
;; Last-Mod: 12-Oct-25 at 12:22:05 by Bob Weiner
;; Last-Mod: 26-Oct-25 at 13:15:29 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand Down Expand Up @@ -1100,7 +1100,9 @@ Make any existing path within a file buffer absolute before returning."
(string-match-p "\\`([^\):]+)" expanded-path)))) ;; Info node
(when (or non-exist (file-exists-p expanded-path)
(string-match-p ".+\\.info\\([.#]\\|\\'\\)" expanded-path))
(concat prefix mode-prefix expanded-path suffix)))))))
(if (string-empty-p expanded-path)
(concat prefix expanded-path suffix)
(concat prefix mode-prefix expanded-path suffix))))))))

(defun hpath:is-path-variable-p (path-var)
"Return a colon or semicolon-delimited set in PATH-VAR or nil if not a match."
Expand Down Expand Up @@ -1503,9 +1505,13 @@ but locational suffixes within the file are utilized."
(if (stringp loc)
(file-name-directory loc)
default-directory)))
;; Parse Hyperbole action prefix char
(when (string-match hpath:prefix-regexp pathname)
(setq modifier (aref pathname 0)
pathname (substring pathname (match-end 0))))
;; Remove http file:// url prefix and decode the url
(when (string-match "\\`file://" pathname)
(setq pathname (hypb:decode-url (substring pathname (match-end 0)))))
(setq path pathname) ;; default
(cond ((string-match hpath:instance-line-column-regexp path)
(setq instance-num (string-to-number (match-string 1 path))
Expand Down Expand Up @@ -1539,7 +1545,11 @@ but locational suffixes within the file are utilized."
(if modifier
(setq path (hpath:resolve path))
(setq path (hpath:expand path)
pathname (hpath:absolute-to path default-directory))))
pathname (hpath:absolute-to path default-directory))
;; Remove http file:// url prefix that`hpath:absolute-to' may have
;; added and decode the url
(when (string-match "\\`file://" pathname)
(setq pathname (hypb:decode-url (substring pathname (match-end 0)))))))
(let ((remote-pathname (hpath:remote-p path)))
(or modifier remote-pathname
(file-exists-p pathname)
Expand Down
7 changes: 4 additions & 3 deletions hywiki.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 21-Apr-24 at 22:41:13
;; Last-Mod: 18-Oct-25 at 11:56:19 by Bob Weiner
;; Last-Mod: 26-Oct-25 at 11:48:45 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand Down Expand Up @@ -2985,9 +2985,10 @@ Customize this directory with:
;; spaces replaced with dashes, made unique when necessary.
(unwind-protect
(progn
(advice-add #'org-export-get-reference :override #'hywiki--org-export-get-reference)
;; (advice-add #'org-export-get-reference :override #'hywiki--org-export-get-reference)
(org-publish-project "hywiki" all-pages-flag))
(advice-remove #'org-export-get-reference #'hywiki--org-export-get-reference)))
;; (advice-remove #'org-export-get-reference #'hywiki--org-export-get-reference)
nil))

(defun hywiki-referent-exists-p (&optional word start end)
"Return the HyWikiWord at point or optional HyWiki WORD, if has a referent.
Expand Down