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

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

bug#61340: 29.0.60; Extra space in xref buffer


From: Dmitry Gutov
Subject: bug#61340: 29.0.60; Extra space in xref buffer
Date: Thu, 9 Feb 2023 00:37:07 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

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)






reply via email to

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