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: Wed, 8 Feb 2023 02:58:02 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

Hi!

On 07/02/2023 09:40, Juri Linkov wrote:
This is a small problem and I didn't notice it until now when
there was an important distinction whether there is a space
character at the beginning of the line, and it was misleading
to see that xref wrongly says there is a leading space.
This is because currently xref output differs from grep and occur
where there is no space between colon and the text from file.
Here is the fix:

```
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index f01b8a1af18..6160f217afb 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -1108,7 +1108,7 @@ 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:" (1+ (floor (log max-line 
10)))))
             with item-text-props = (list 'mouse-face 'highlight
                                          'keymap xref--button-map
                                          'help-echo
```

This was originally an effort to give the outputted text some "breathing room", and I think it looks a little better.

But if it can cause problems sometimes, I don't mind the proposed change. After all, both Grep and Occur don't have this space, and consistency is good.





reply via email to

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