Subject: bug#49846: 28.0.50; project-find-regexp results does not open target file

From: Juri Linkov <[email-masked]>
Date: Wed, 04 Aug 2021 23:10:10 +0300

> Steps to reproduce:
> 1. emacs -Q
> 2. C-x p p (project-switch-project)
> 3. select project
> 4. press g (Find Regexp) and search for a term then RET
> 5. In the results select any file
>
> Result: No reference at point
>
> Expectation: step-5 should open the file-at-point and point should be
> placed at a suitable place in the opened file.

I have the same problem.  When calling xref-find-references
from a subdirectory, not from the project root, it creates
an *xref* buffer where file names are relative to the
project root (when xref-file-name-display is 'project-relative'),
but the default directory is not the project root.
So using file-at-point fails to find the relative file.

But I don't see the same problem with project-find-regexp,
it correctly changes the directory to the project root,
and opens the file-at-point.