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 08:10:46 +0100

On Wed, 23 Dec 2020 at 03:16, Dmitry Gutov <dgutov@yandex.ru> wrote:
Hi Tobias,

On 09.12.2020 17:08, Tobias Rittweiler wrote:

> please find patches attached to this e-mail that make it possible to
> set 'xref-file-name-display' to 'relative-to-project-root'. If so set,
> the file names in the *xref* buffer will be shortened by the 'project-root'
> and 'project-external-roots' of 'project-current'. Note that xref.el already
> requires 'project'.
>
> The patches are relative to commit 2581beb from Wed Dec 9 00:54:34 2020
> +0000

Could you clarify the reason for the first patch? Did you have any test
failures (on Ubuntu 20.04.1?) with the current test code because of the
"random" filesystem traversal order? Thanks!

The original code *did* already fix the file order in the test where it actually mattered:
'xref-matches-in-directory-finds-some-for-bar'. Note that no other test actually involve
locations from multiple files in a way that is dependent on the order.

The patch does not serve any actual utility except for code hygiene: it reduces a bit
of trivial code duplication. Feel free to ignore it. (But in case you do add tests for
'xref-file-name-display' being 'relative', please make sure you write the tests in a way
that makes it independent from the filesystem traversal order.)
 
Tobias

reply via email to

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