Skip to content

Complete over buffer anchors in adoc-goto-ref-label#79

Merged
bbatsov merged 1 commit into
masterfrom
goto-anchor-completion
Jun 4, 2026
Merged

Complete over buffer anchors in adoc-goto-ref-label#79
bbatsov merged 1 commit into
masterfrom
goto-anchor-completion

Conversation

@bbatsov

@bbatsov bbatsov commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Small ergonomics win: adoc-goto-ref-label (C-c C-a) used to make you type the anchor id from memory. Now it offers the buffer's anchors via completing-read, reusing the adoc--collect-anchor-ids collector from the completion work. It stays permissive (no require-match), so an id that isn't defined yet can still be entered, and the cross-reference at point is still the default.

This came out of a quick survey of which commands read from the minibuffer - adoc-goto-ref-label was the one clear candidate (the only other reads are adoc-insert-link's URL/text, which have no good completion source).

  • The commits are consistent with our contribution guidelines
  • You've added tests (if possible) to cover your change(s)
  • All tests are passing (eldev test)
  • The new code is not generating bytecode or M-x checkdoc warnings
  • You've updated the changelog (if adding/changing user-visible functionality)
  • You've updated the readme (if adding/changing user-visible functionality)

C-c C-a asked you to type the anchor id blind; now it offers the buffer's
anchors via completing-read (reusing adoc--collect-anchor-ids). It stays
permissive so a not-yet-defined id can still be entered, and the xref at
point remains the default.
@bbatsov bbatsov merged commit 0f5e2f8 into master Jun 4, 2026
8 checks passed
@bbatsov bbatsov deleted the goto-anchor-completion branch June 4, 2026 14:00
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