From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#47012: xref copies keymap properties to minibuffer Date: Thu, 01 Apr 2021 11:43:40 +0300 Organization: LINKOV.NET Message-ID: <87zgyiv03f.fsf@mail.linkov.net> References: <87czw9tnu9.fsf@mail.linkov.net> <3aad442a-7319-5db5-2fc6-560bb032c34d@yandex.ru> <87a6r9v24b.fsf@mail.linkov.net> <87sg4kb839.fsf@mail.linkov.net> <871rc3bls6.fsf@mail.linkov.net> <871rc2ly7x.fsf@mail.linkov.net> <4228b128-039c-2bcd-002c-5ac830d7a4d3@yandex.ru> <87pmzgtr80.fsf@mail.linkov.net> <186b46fa-3716-a76d-db85-09638d7805c7@yandex.ru> <87v99745jj.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16232"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 47012@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 01 11:17:12 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lRtRv-000479-Bn for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 01 Apr 2021 11:17:11 +0200 Original-Received: from localhost ([::1]:57406 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRtRu-0002o5-CQ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 01 Apr 2021 05:17:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRtRm-0002mP-Iy for bug-gnu-emacs@gnu.org; Thu, 01 Apr 2021 05:17:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44758) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lRtRm-0003Ri-CB for bug-gnu-emacs@gnu.org; Thu, 01 Apr 2021 05:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lRtRm-0001OC-8d for bug-gnu-emacs@gnu.org; Thu, 01 Apr 2021 05:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Apr 2021 09:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47012 X-GNU-PR-Package: emacs Original-Received: via spool by 47012-submit@debbugs.gnu.org id=B47012.16172686055307 (code B ref 47012); Thu, 01 Apr 2021 09:17:02 +0000 Original-Received: (at 47012) by debbugs.gnu.org; 1 Apr 2021 09:16:45 +0000 Original-Received: from localhost ([127.0.0.1]:56304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lRtRU-0001NW-VB for submit@debbugs.gnu.org; Thu, 01 Apr 2021 05:16:45 -0400 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]:35279) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lRtRT-0001NG-8Z for 47012@debbugs.gnu.org; Thu, 01 Apr 2021 05:16:43 -0400 X-Originating-IP: 91.129.107.223 Original-Received: from mail.gandi.net (m91-129-107-223.cust.tele2.ee [91.129.107.223]) (Authenticated sender: juri@linkov.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 0A90B1C0002; Thu, 1 Apr 2021 09:16:35 +0000 (UTC) In-Reply-To: (Dmitry Gutov's message of "Thu, 1 Apr 2021 04:16:08 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:203418 Archived-At: > But it does create an analogy with Grep, which is one of the main places > where we're used to seeing file names in a list. Thus looking at the green > color we're likely to make a connection and see that this line shows > a file name. > > I'm not as much beholden to this color exactly, as to the idea of using > *some* color for this purpose. And I don't know of better prior art. > > Regarding file names on the left, Grep does that, but look at ripgrep in > the console, or the deadgrep Emacs package. Neither add any extra > decorations to the line except emphasizing it with a different color > (admittedly not green in these two cases) and (maybe) bold font weight. > > Or look at ack or SilverSearcher, which both use green for file names, > while using the same grouping layout that we do (they had been an > inspiration, even though we've inherited the xref UI from SLIME): > > https://altbox.dev/ack/screenshot.png > https://spinorlab.wordpress.com/2015/08/15/the-silver-searcher/ But all of them display green foreground file names with yellow background matches. This is exactly what grep.el does by default, so it's the reason why output of grep.el is readable, but output of xref.el is not. The problem is that currently in xref both file names and matches use the same color green. The only difference is that file names are displayed with green foreground, and matches with green background. What causes the difficulty in readability is the effect similar to https://en.wikipedia.org/wiki/Stroop_effect that causes the delay in reaction time between congruent and incongruent stimuli. Using exactly the same grep colors in xref by changing 'xref-match' to inherit from the 'match' face completely solves this problem. >> 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. > > Please try (setq xref-file-name-display 'project-relative). Thanks, I didn't know about this. Shouldn't this be the default value since this is what's displayed by grep and ripgrep. Actually, there is no exact option for what grep and ripgrep do, because they display file names relative to the search directory. But currently there is no xref option to display file names relative to the subdirectory specified by 'C-u C-x p g'.