Skip to content

Fix "xref-pop-to-location: Marker does not point anywhere"#80

Merged
xvw merged 1 commit into
tarides:mainfrom
janestreet:small-fix-1
Jan 19, 2026
Merged

Fix "xref-pop-to-location: Marker does not point anywhere"#80
xvw merged 1 commit into
tarides:mainfrom
janestreet:small-fix-1

Conversation

@bcc32

@bcc32 bcc32 commented Jan 5, 2026

Copy link
Copy Markdown
Contributor

Avoid a possible error when jumping to a position in a file that is
out of bounds, due to the jumped-to file containing line number
directives. E.g., if target.ml's first line is "# 100 "target.ml"",
the right place to jump for line 100 would be the second physical line
of the file, but getting this right would be quite complex. As a
first step, just produce some valid position in the right buffer so
that xref-find-definitions does not fail completely.

The ultimate error manifests as:

xref-pop-to-location: Marker does not point anywhere

(and the xref-find-definitions command jumps to some random buffer):
due to the xref-location-marker method returning a marker that does
not point anywhere.

@xvw

xvw commented Jan 5, 2026

Copy link
Copy Markdown
Member

Hey @bcc32!
Thanks a lot!
Any chances to review this #72 and adapt this PR on top of #72 ?

Avoid a possible error when jumping to a position in a file that is
out of bounds, due to the jumped-to file containing line number
directives.  E.g., if target.ml's first line is "# 100 \"target.ml\"",
the right place to jump for line 100 would be the second physical line
of the file, but getting this right would be quite complex.  As a
first step, just produce *some* valid position in the right buffer so
that xref-find-definitions does not fail completely.

The ultimate error manifests as:

    xref-pop-to-location: Marker does not point anywhere

(and the xref-find-definitions command jumps to some random buffer):
due to the xref-location-marker method returning a marker that does
not point anywhere.
@xvw xvw merged commit 5aff883 into tarides:main Jan 19, 2026
5 checks passed
@bcc32 bcc32 deleted the small-fix-1 branch January 19, 2026 17:24
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.

2 participants