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

From: Eli Zaretskii <[email-masked]>
Date: Thu, 04 Mar 2021 17:13:20 +0200

> Date: Thu, 04 Mar 2021 14:39:23 +0000
> From: Gregory Heytings <[email-masked]>
> cc: [email-masked]
> 
> But you provide the solution: when an xref is followed, the file is opened 
> in a buffer, at which point buffer-file-coding-system is set.  So it seems 
> that it suffices to do (goto-char (filepos-to-bufferpos 
> (get-byte-position))).

Yes.  But it can be slow.

> I just did a filepos-to-bufferpos for one of the last bytes of a 6 MB 
> Latin-1 file, and it took only ~2 ms.

Which value of QUALITY did you use?

Also, what happens with multibyte encodings that are not UTF-8, like
iso-2022, for example?