GNU bug report logs -
#36967
27.0.50; Duplicate lines in xref output
Previous Next
Reported by: Juri Linkov <juri <at> linkov.net>
Date: Wed, 7 Aug 2019 22:04:01 UTC
Severity: normal
Merged with 43715
Found in versions 27.0.50, 28.0.50
Fixed in version 28.1
Done: Dmitry Gutov <dgutov <at> yandex.ru>
Bug is archived. No further changes may be made.
Full log
Message #28 received at 36967 <at> debbugs.gnu.org (full text, mbox):
On 06.12.2020 22:31, Juri Linkov wrote:
>> I'm _slightly_ worried about extra garbage if we do seq-group-by twice
>> (with an extra list for every line, even those that don't need it), but
>> that's what benchmarking is for (can do that later).
>
> I'm worried about extra garbage too, so this patch doesn't cause extra lists.
Thanks! Seems to work well. Especially with this addition:
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 9f5fc57142..9ad956d496 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -595,7 +595,8 @@ xref-prev-line
(defun xref--item-at-point ()
(save-excursion
- (back-to-indentation)
+ (when (eolp)
+ (forward-char -1))
(get-text-property (point) 'xref-item)))
(defun xref-goto-xref (&optional quit)
> However, there is a problem: when xref--insert-xrefs is called by
> 'M-.' that uses etags, then it signals an error:
Does it happen when two symbols do indeed get defined on the same line?
Sounds like a rare situation.
> cl-no-applicable-method xref-file-location-column
>
> And I don't know how to fix etags to add columns.
Using xref-file-location-column there kind of breaks the abstraction. I
was thinking more along the lines of text-prop search for the column
inside the summary string:
(setq column
(with-temp-buffer
(insert summary)
(goto-char (point-min))
(let ((match
(text-property-search-forward
'face 'xref-match
(lambda (target value)
(or (eq target value)
(and (listp value)
(member target value)))))))
(and match
(1- (prop-match-beginning match))))))
That's quite a bit longer, though. And it still will work only with some
kinds of xrefs: I'm not sure I know how to add columns to etags either.
Not to mention third-party xref backends.
The rest won't get deduplication, but that's probably all right.
This bug report was last modified 4 years and 154 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.