Find Antora cross-references project-wide#84
Merged
Conversation
In an Antora component, M-? (xref-find-references) on an id now greps the whole component instead of only the current buffer, so cross-page references - xref:this/page.adoc#id[] from other pages, including module:-qualified forms - show up alongside the same-page <<id>> / xref:id[] usages. Outside a component the search stays in-buffer. Built on xref-matches-in-directory; the match regexp is a flat alternation (no shy group) so grep -E accepts it under GNU grep too. Phase 2c of the Antora/xref work.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 2c of the Antora/xref work, completing the cross-file story.
In an Antora component,
M-?(xref-find-references) on an id now searches the whole component rather than just the current buffer. So you see every cross-page reference -xref:this/page.adoc#id[]from other pages, includingmodule:-qualified forms - alongside the same-page<<id>>/xref:id[]usages. Outside a component it stays in-buffer as before.It's built on Emacs' own
xref-matches-in-directory(grep). The match regexp distinguishes by page+fragment, so a same-id-but-different-page reference isn't a false positive, and prefix collisions (foovsfoobar) are excluded.Notably I tested this against both BSD grep (my machine) and GNU grep 3.12 (the CI/Linux flavor) - an earlier version used a shy group that BSD grep tolerated but GNU grep rejects, which would have broken
M-?on CI; the committed regexp is a flat alternation that both accept.That wraps up Phase 2 (Antora xref: following, completion, references). Next: paste-image-from-clipboard.
eldev test)M-x checkdocwarnings