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

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

bug#36573: 26.1; bufferpos-to-filepos assumes coding-system-eol-type giv


From: Eli Zaretskii
Subject: bug#36573: 26.1; bufferpos-to-filepos assumes coding-system-eol-type gives integer
Date: Thu, 12 Aug 2021 11:21:07 +0300

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Wed, 11 Aug 2021 20:42:08 +0200
> Cc: 36573@debbugs.gnu.org
> 
> > I think it probably still makes sense to add a note to the manual for
> > bufferpos-to-filepos and filepos-to-bufferpos to point out that they
> > don't work if the line ending convention is unknown.
> 
> Well, manual does say that the coding system has to be known (which
> implies that the line ending convention should also be known)...
> 
> > For bonus points, maybe it makes sense to add something to fail
> > earlier (and more understandably!) in the info reading code. I'm not
> > sure exactly where that would be, though.
> 
> I think those functions probably shouldn't signal an error in this
> situation if asked to do an approximate calculation (but just guess at a
> one-byte ending), perhaps.  But give a better error message when asked
> to do an exact calculation.

I think, since these cases are very rare, it should be okay to assume
the -unix EOL type when this happens, and document that if this is the
case, the result could be an approximation even if the exact result
was requested.





reply via email to

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