From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#61340: 29.0.60; Extra space in xref buffer Date: Thu, 9 Feb 2023 00:37:07 +0200 Message-ID: References: <868rh9zzws.fsf@mail.linkov.net> <6a7e3db4-bc2b-2742-bc6c-ad9da8203b85@yandex.ru> <86r0v0zk1o.fsf@mail.linkov.net> <86r0v080cf.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11407"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Cc: 61340@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 08 23:38:28 2023 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 1pPt5A-0002p5-ND for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 08 Feb 2023 23:38:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPt4l-0004AX-Oc; Wed, 08 Feb 2023 17:38:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pPt4k-0004AJ-JM for bug-gnu-emacs@gnu.org; Wed, 08 Feb 2023 17:38:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPt4k-0000wY-B2 for bug-gnu-emacs@gnu.org; Wed, 08 Feb 2023 17:38:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pPt4k-0006UT-7l for bug-gnu-emacs@gnu.org; Wed, 08 Feb 2023 17:38:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Feb 2023 22:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61340 X-GNU-PR-Package: emacs Original-Received: via spool by 61340-submit@debbugs.gnu.org id=B61340.167589584024864 (code B ref 61340); Wed, 08 Feb 2023 22:38:02 +0000 Original-Received: (at 61340) by debbugs.gnu.org; 8 Feb 2023 22:37:20 +0000 Original-Received: from localhost ([127.0.0.1]:56857 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPt43-0006Sx-JZ for submit@debbugs.gnu.org; Wed, 08 Feb 2023 17:37:20 -0500 Original-Received: from mail-wr1-f45.google.com ([209.85.221.45]:35592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPt3z-0006Sf-Iv for 61340@debbugs.gnu.org; Wed, 08 Feb 2023 17:37:17 -0500 Original-Received: by mail-wr1-f45.google.com with SMTP id y1so65292wru.2 for <61340@debbugs.gnu.org>; Wed, 08 Feb 2023 14:37:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=md0hao9VQsND1ZX8y16R7eOZ3yhK0w0xgULXFFbkDy0=; b=EOzGoK0HaFqrp4HCAo4/4pBxworSv7zZSxnW9xV6HTjETlNEXyc2jsgxmtDPjao55W iuyONNsK1HHVTGjx871L6qY7LeDiVAd7tZhwY2RX008B6xvLT8cWj6ygOnF/7eUe4jIu GYVqzmmS55Zk//3Atksmw4yqG6zQ4+b33BLZRL2XCSpIdClE7Nc2jFdstFv5Z1TIVkfK K0v+hGZiYBJNAoNoMqaqDgcXKMQqn2OdQOpUOaf8EHAIJbGz7P/MGa9c7lUO+1qX4UvP 7vnjZNZOrrJ3XuqUKPN2st2WF94CzZBcQ/KK/+P763rkmZ6LfDUnENo25zROSKG/F9F3 kLfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=md0hao9VQsND1ZX8y16R7eOZ3yhK0w0xgULXFFbkDy0=; b=viLC5thlN0neDIkbz6wk0qtBfnX6Uek7q8iODRUFGk2JS3nYa1c9sLb8IjJ8j0F5va fU7z7LjNB32dYeSmmmYjE6z9ZS5+NyFO4rLFWtiNgFQcXapi9wxJrivsgjXDV8NrbEJ/ JTLo80EQSv3qLIGVps4KS5bldffXVNgKq3wnWtzU9y11ZstxWKSpsqvHBgCUCZixYAsz mMGHaBxWGZurkBwZEgTCw8zGwtKZEgmtvrTyoOT2qGomC876f8XKeVhYqKgX+H07Tn3W BiE0UzT8sCTDipV4ceeHWARZmxtLFK5n6+Wdl1KjOgql2IoeVZC45qUGnQ8TTy7fG7Sf mkbg== X-Gm-Message-State: AO0yUKUcLzM+wTvwjN/oUpdOwfRUlbHthwHwR795W1u1Kb7BnZZKPtNd DSG+0fLGTCAaMRaBbYN9D4g= X-Google-Smtp-Source: AK7set/V5I+EGQ9xkPbNFhVKLHrIUMhCad7Rtk78zRXy71uCNq/1J6kk4iBNclQo83pZc9EAxRoA5w== X-Received: by 2002:adf:f4cf:0:b0:2bf:c066:dd7e with SMTP id h15-20020adff4cf000000b002bfc066dd7emr8670983wrp.40.1675895829669; Wed, 08 Feb 2023 14:37:09 -0800 (PST) Original-Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id k21-20020a05600c1c9500b003e01493b136sm3281538wms.43.2023.02.08.14.37.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Feb 2023 14:37:09 -0800 (PST) Content-Language: en-US In-Reply-To: <86r0v080cf.fsf@mail.linkov.net> 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:255167 Archived-At: On 08/02/2023 20:51, Juri Linkov wrote: >>>> This was originally an effort to give the outputted text some "breathing >>>> room", and I think it looks a little better. >>> Indeed, it looks better but unfortunately at the cost of caused ambiguity. >>> I guess this is the reason why Grep and Occur don't add space. >> I suppose we could try to tone down the colon. Occur uses 'shadow' for both >> the number and the colon; Grep uses the color from 'default' (with an >> underline). >> >> If we fontify it with 'shadow' rather than 'xref-line-number', that might >> look a little better. > I already forgot that the default color is too glaring since I customized > it long ago to '(xref-line-number ((t (:inherit shadow)))). But I also > customized other xref faces e.g. '(xref-file-header ((t (:extend t > :background "grey90")))), so these faces provide a better look. > OTOH, I'm not sure if the default of xref-line-number can be changed > because on the one hand the purple color from compilation-line-number > is needed in grep to make them more noticeable because the line numbers > are in the middle of the line unlike in occur. But on the other hand > the current theme of xref buffers matches all colors of grep, so any > change will make their default themes different. Here's the change I was suggesting. The difference is subtle, but seems like an improvement: diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 63e065e696e..581eda0513e 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1126,7 +1126,9 @@ xref--insert-xrefs maximize (xref-location-line (xref-item-location xref))) for line-format = (and max-line - (format "%%%dd:" (1+ (floor (log max-line 10))))) + (format + #("%%%dd:" 0 4 (face xref-line-number) 5 6 (face shadow)) + (1+ (floor (log max-line 10))))) with item-text-props = (list 'mouse-face 'highlight 'keymap xref--button-map 'help-echo @@ -1146,8 +1148,7 @@ xref--insert-xrefs ((and (equal line prev-line) (equal prev-group group)) "") - (t (propertize (format line-format line) - 'face 'xref-line-number))))) + (t (format line-format line))))) ;; Render multiple matches on the same line, together. (when (and (equal prev-group group) (or (null line)