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

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

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


From: Dmitry Gutov
Subject: bug#46859: 28.0.50; [PATCH]: Add option to truncate long lines in xref.el
Date: Sun, 7 Mar 2021 05:22:29 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 07.03.2021 00:26, Dmitry Gutov wrote:
- What do you think about making an effort to actually retain all the matches in the output? That would mean interpreting the xref-truncate-line-to value (or however the var could be renamed) as the maximum number of chars to render on the line *per match*. And if there is too much text between them, those parts can become "(truncated...)". Your current implementation can cut off valid matches, and we probably want to preserve them if feasible. OTOH, the default value could go down to 200 with this approach.

Please try out the attached preparation patch.

It improves the performance of the "very long line" case drastically over here, while not doing any truncation yet. Looks like we regressed that case when we added rendering of multiple matches on the same line.

We can add the truncation feature on top of it.

Probably also in xref--collect-matches-1 (truncating the value of SUMMARY just before the xref-make-match call).

Alternatively, we could experiment with hiding parts of the long line using some display/visibility features (except the truncate-lines variable, that one keeps things slow). That could be done in xref--insert-xrefs or somewhere nearby. That is trickier, though, given that we'll probably want to unhide it (wholly or partially) when iterating over matches inside.

Attachment: xref-insert-xrefs-sparingly.diff
Description: Text Data


reply via email to

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