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

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

bug#47012: xref copies keymap properties to minibuffer


From: Juri Linkov
Subject: bug#47012: xref copies keymap properties to minibuffer
Date: Wed, 31 Mar 2021 20:05:52 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

>>   -(defface xref-file-header '((t :inherit compilation-info))
>> +(defface xref-file-header '((t :background "grey90" :extend t))
>>     "Face used to highlight file header in the xref buffer."
>>     :version "27.1")
>> #+end_src
>
> I'm not sure I like the result. Simply applying your change to the face
> results in a color-less buffer with grey spots for both file headers and

It's good that the buffer is color-less since this improves readability
because in such cases colors add distraction.

> match highlights (at least, with my current theme).

Indeed, it adds grey lines for file headers, but there are
no grey lines for match highlights by default.

> It's less of a problem with diff-mode because its basic background is
> grey already.

The proposed change is for the default theme.
If the proposed change doesn't fit your personal theme customization,
this is fine.  At least, please mention in the docstring a suggestion
how the users could improve the readability of this face.

> I've also considered something like:
>
> (defface xref-file-header '((t :background "grey90" :extend t :inherit 
> compilation-info))
>   "Face used to highlight file header in the xref buffer."
>   :version "27.1")
>
> ...but it makes the file names harder to read because of the
> reduced contrast.

I agree, this is not an improvement.

> Then I've tried to see what others do, for instance
> https://github.com/Wilfred/deadgrep, which I'd heard people praise
> usability of.
>
> The only distinction it adds to file names is "bold :t". And diff-mode also
> does that, actually.
>
> So... how do you like this simple change?
>
> (defface xref-file-header '((t :bold t :inherit compilation-info))
>   "Face used to highlight file header in the xref buffer."
>   :version "27.1")

This is exactly what I used as customization for a long time,
and it was a pain with so much of "visual garbage", until I realized
there is the existing solution in diff-mode faces.

It seems you're inclined to keep the green color because this is what
is used in grep, right?  But in grep, the green color on file names
doesn't add distraction because file names are located on the left,
whereas matches are on the right part of the output.  But in xref output
lines with file names and lines with matches are interlaced.

Another suggestion how to remove "visual garbage" is to truncate
duplicate prefixes: currently the prefixes of long absolute file names
are repeated for all file names.  It would improve readability
to display shorter relative file names without duplicate project root part.





reply via email to

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