Skip to content

Change path substitution var insertion#999

Open
matsl wants to merge 1 commit into
masterfrom
pr_fix_path_variable_substitution_insertion
Open

Change path substitution var insertion#999
matsl wants to merge 1 commit into
masterfrom
pr_fix_path_variable_substitution_insertion

Conversation

@matsl

@matsl matsl commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

What

Change path substitution var insertion.

Only insert variable if it matches the first pos in the path.

  • hpath.el (hpath:substitute-var): Try the substitution on the
    absolute path.
    (hpath:substitute-var-name): Anchor regexp substitution on first pos.

  • test/hpath-tests.el (hpath:substitute-var-test):
    (hpath:substitute-var-name-test): Unit tests.

Why

When linking to a line in a file in the hyperb:dir where a relative
link would be created the var was substituted in the path but kept as
a relative path. Like this:
"..${hyperb:dir}/README.md:L14"
Since it is a path with a variable it should be absolute.

Only insert variable if it matches the first pos in the path.

* hpath.el (hpath:substitute-var): Try the substitution on the
absolute path.
(hpath:substitute-var-name): Anchor regexp substitution on first pos.

* test/hpath-tests.el (hpath:substitute-var-test):
(hpath:substitute-var-name-test): Unit tests.
@matsl matsl requested a review from rswgnu July 4, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant