On Sat, 26 Dec 2020 at 03:21, Dmitry Gutov wrote: > On 23.12.2020 04:16, Dmitry Gutov wrote: > > Re: patch 2, I have an idea that would make it a bit simpler and less > > coupled to project.el, but behave the same in the usual cases. Stay > tuned. > > Not as clean as I hoped, but here's something that should work just as > well, and a lot faster to boot (project-current lookup for every file > name is slow when there are a lot of matches, even if each individual > project-current call looks fast). > > We could remove the explicit dependency on the "current project" if it > was always passed in from the outside (e.g. by project-find-regexp's > setup), but we probably want this display mode to work with > xref-find-references as well. > > Also simplified the docstring a bit. > > Tobias, please try the attached patch. > Hi Dmitry, Thank you. I tested the patch and it works fine. Some comments on the patch itself: 1. 'xref--project-root' returns a project root if 'project-root' is fboundp. Otherwise it returns a *list* of roots. 2. And in the second case, 'xref-backend-references' conses that list of roots to the list of external roots. I.e. it constructs an improper list which it then passes to 'mapcan'. This is a bug, isn't it? 3. 'xref-expanded-seach-root` mispells "search"