From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#36573: 26.1; bufferpos-to-filepos assumes coding-system-eol-type gives integer Date: Thu, 12 Aug 2021 11:21:07 +0300 Message-ID: <831r6zdqfg.fsf@gnu.org> References: <877e8q2mc7.fsf@halibut> <87o91zs2sm.fsf@halibut> <87eeazq0vz.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25633"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 36573@debbugs.gnu.org, rswarbrick@gmail.com To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 12 10:22:11 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mE5yb-0006Hr-IO for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Aug 2021 10:22:09 +0200 Original-Received: from localhost ([::1]:58304 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mE5ya-0001Vv-CN for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Aug 2021 04:22:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59930) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mE5yU-0001Vn-LT for bug-gnu-emacs@gnu.org; Thu, 12 Aug 2021 04:22:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54135) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mE5yU-0004a8-EP for bug-gnu-emacs@gnu.org; Thu, 12 Aug 2021 04:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mE5yU-00088U-4r for bug-gnu-emacs@gnu.org; Thu, 12 Aug 2021 04:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Aug 2021 08:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36573 X-GNU-PR-Package: emacs Original-Received: via spool by 36573-submit@debbugs.gnu.org id=B36573.162875649031223 (code B ref 36573); Thu, 12 Aug 2021 08:22:02 +0000 Original-Received: (at 36573) by debbugs.gnu.org; 12 Aug 2021 08:21:30 +0000 Original-Received: from localhost ([127.0.0.1]:37448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mE5xy-00087X-4F for submit@debbugs.gnu.org; Thu, 12 Aug 2021 04:21:30 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:51088) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mE5xw-00087H-Qa for 36573@debbugs.gnu.org; Thu, 12 Aug 2021 04:21:29 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:59750) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mE5xr-000408-If; Thu, 12 Aug 2021 04:21:23 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4560 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mE5xr-0005dP-5o; Thu, 12 Aug 2021 04:21:23 -0400 In-Reply-To: <87eeazq0vz.fsf@gnus.org> (message from Lars Ingebrigtsen on Wed, 11 Aug 2021 20:42:08 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:211652 Archived-At: > From: Lars Ingebrigtsen > 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.