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 21:45:38 +0300 Organization: LINKOV.NET Message-ID: <87o8exsv1p.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> <87zgyiv03f.fsf@mail.linkov.net> <4d3edf81-97d8-4e0e-51c0-7b2d71b57889@yandex.ru> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20990"; 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 20:53:19 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 1lS2RT-0005LZ-Dd for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 01 Apr 2021 20:53:19 +0200 Original-Received: from localhost ([::1]:48088 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lS2RS-0005ru-Dx for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 01 Apr 2021 14:53:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41588) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lS2RC-0005rB-FI for bug-gnu-emacs@gnu.org; Thu, 01 Apr 2021 14:53:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47131) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lS2RC-0000M1-7j for bug-gnu-emacs@gnu.org; Thu, 01 Apr 2021 14:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lS2RC-0000Jr-6v for bug-gnu-emacs@gnu.org; Thu, 01 Apr 2021 14:53: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 18:53: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.16173031611199 (code B ref 47012); Thu, 01 Apr 2021 18:53:02 +0000 Original-Received: (at 47012) by debbugs.gnu.org; 1 Apr 2021 18:52:41 +0000 Original-Received: from localhost ([127.0.0.1]:58677 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lS2Qq-0000JH-UF for submit@debbugs.gnu.org; Thu, 01 Apr 2021 14:52:41 -0400 Original-Received: from relay1-d.mail.gandi.net ([217.70.183.193]:33645) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lS2Qp-0000J3-7w for 47012@debbugs.gnu.org; Thu, 01 Apr 2021 14:52:40 -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 relay1-d.mail.gandi.net (Postfix) with ESMTPSA id C2573240006; Thu, 1 Apr 2021 18:52:31 +0000 (UTC) In-Reply-To: <4d3edf81-97d8-4e0e-51c0-7b2d71b57889@yandex.ru> (Dmitry Gutov's message of "Thu, 1 Apr 2021 17:13:52 +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:203441 Archived-At: --=-=-= Content-Type: text/plain >> Using exactly the same grep colors in xref by changing >> 'xref-match' to inherit from the 'match' face >> completely solves this problem. > > You are right. I could even say "unfortunately", because IMHO the bright > yellow highlights are too much. Too strong emphasis, visually. > > So let's change it to inherit from 'match', because that's what that face > is documented to be used for. > > Additionally, what do you think about toning down 'match''s background > color? Maybe use some subtler yellow like "lemon chiffon" or "khaki1"? Or > "light goldenrod". Such toning down is welcome since currently match's background is too intense. Actually, I customized it long ago to "#ffff88" on one display, and to "#ffffbb" on another display. I guess "#ffffbb" is too radical, but "#ffff88" should be fine and close to "khaki1" that is nicely looking as well. Another variant is to update gradually, i.e. start with "#ffff66", then after some time to "#ffff88". >>> 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. > > I wouldn't mind, personally. This is added to the patch below too. >> 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'. > > This issue is tricky because xref-find-definitions does not assume the > presence of a project, or even of any kind of containing directory. And > yet, it's handy to show its results with relative file names when possible, > too. So I picked "relative to the project" as the option value, and the > corresponding logic. > > I think what you're talking about is only a problem when the directory has > no containing project at all. In that case we could probably default to the > value of default-directory as the reference. Maybe it would be nice to default to default-directory even when 'C-u C-x p g' is used in a project. What is the real problem for me is that after navigating to a project's subdirectory (with e.g. dired) and typing 'C-u C-x p g', it doesn't provide the current directory as the default value. It inserts the project root by default, not its subdirectory: Base directory: /project/root/ whereas 'M-x rgrep' conveniently provides default-directory as default. BTW, is it possible to make 'project-find-regexp' more compatible with 'rgrep' in other features too? What is missing is a way to modify the constructed command line. For example, often I need to add "-w" to the constructed command to match words only. In 'C-u M-x rgrep', this is easy to do, but not in 'C-u C-x p g'. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=match.patch diff --git a/lisp/replace.el b/lisp/replace.el index f131d263ec..07b2d59a25 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -1433,7 +1433,7 @@ occur-next-error (defface match '((((class color) (min-colors 88) (background light)) - :background "yellow1") + :background "#ffff66") (((class color) (min-colors 88) (background dark)) :background "RoyalBlue3") (((class color) (min-colors 8) (background light)) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index ea52befec5..cada1f1109 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -103,7 +103,7 @@ xref-match-length ;;;; Commonly needed location classes are defined here: -(defcustom xref-file-name-display 'abs +(defcustom xref-file-name-display 'project-relative "Style of file name display in *xref* buffers. If the value is the symbol `abs', the default, show the file names @@ -521,7 +521,7 @@ xref-line-number "Face for displaying line numbers in the xref buffer." :version "27.1") -(defface xref-match '((t :inherit highlight)) +(defface xref-match '((t :inherit match)) "Face used to highlight matches in the xref buffer." :version "27.1") --=-=-=--