bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#45135: 28.0.50; [PATCH] Add option to print file names in *xref* buf


From: Tobias Rittweiler
Subject: bug#45135: 28.0.50; [PATCH] Add option to print file names in *xref* buffer relative to project root
Date: Sun, 27 Dec 2020 07:55:41 +0100

On Sat, 26 Dec 2020 at 03:21, Dmitry Gutov <dgutov@yandex.ru> 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" 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]