unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 47012@debbugs.gnu.org
Subject: bug#47012: xref copies keymap properties to minibuffer
Date: Wed, 31 Mar 2021 20:05:52 +0300	[thread overview]
Message-ID: <87v99745jj.fsf@mail.linkov.net> (raw)
In-Reply-To: <186b46fa-3716-a76d-db85-09638d7805c7@yandex.ru> (Dmitry Gutov's message of "Wed, 31 Mar 2021 18:47:30 +0300")

>>   -(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.





  parent reply	other threads:[~2021-03-31 17:05 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-08 20:03 bug#47012: xref copies keymap properties to minibuffer Juri Linkov
2021-03-09  2:08 ` Dmitry Gutov
2021-03-11 20:58   ` Juri Linkov
2021-03-24 20:38     ` Juri Linkov
2021-03-24 21:57       ` Dmitry Gutov
2021-03-25  9:40         ` Juri Linkov
2021-03-25 10:57           ` Dmitry Gutov
2021-03-25 21:28             ` Juri Linkov
2021-03-25 22:12               ` Dmitry Gutov
2021-03-30 19:16                 ` Juri Linkov
2021-03-31 15:47                   ` Dmitry Gutov
2021-03-31 15:59                     ` Eli Zaretskii
2021-03-31 16:10                       ` Dmitry Gutov
2021-03-31 16:57                         ` Eli Zaretskii
2021-04-01  0:25                           ` Dmitry Gutov
2021-04-01  7:17                             ` Eli Zaretskii
2021-03-31 17:05                     ` Juri Linkov [this message]
2021-04-01  1:16                       ` Dmitry Gutov
2021-04-01  8:43                         ` Juri Linkov
2021-04-01 14:13                           ` Dmitry Gutov
2021-04-01 18:45                             ` Juri Linkov
2021-04-01 19:06                               ` Eli Zaretskii
2021-04-01 21:28                                 ` Dmitry Gutov
2021-04-02  6:08                                   ` Eli Zaretskii
2021-04-02 23:50                                     ` Dmitry Gutov
2021-04-03  7:24                                       ` Eli Zaretskii
2021-04-03 18:12                                         ` Dmitry Gutov
2021-04-03 18:19                                           ` Eli Zaretskii
2021-04-02  8:20                                 ` Juri Linkov
2021-04-01 22:43                               ` Dmitry Gutov
2021-04-02  8:25                                 ` Juri Linkov
2021-04-02 23:23                                   ` Dmitry Gutov
2021-04-04 22:55                                     ` Juri Linkov
2021-04-05  2:15                                       ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v99745jj.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=47012@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).