Subject: Re: bug#46859: 28.0.50; [PATCH]: Add option to truncate long lines in xref.el

From: Dmitry Gutov <[email-masked]>
Date: Sat, 6 Mar 2021 14:37:26 +0200

On 06.03.2021 14:31, Dmitry Gutov wrote:
> Otherwise it would be possible to use this approach (by introducing a 
> Grep-specific location type) and avoid parsing the line contents for 
> every match.

Except, um, we still need to fill in the "summary" attribute for all 
matches, so that there is something to display in the Xref buffer (the 
line contents around the match), and the -o flag strips those.

And if we were to use the '.{0,100}file.{0,100}' trick, it messes up the 
location of the match, the reported byte offset become unreliable. Also: 
grepping for that kind of regexp is noticeably slower than grepping for 
'file'. Or even '.file'. Like 85ms vs 7ms slower.