From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Teddy Hogeborn Newsgroups: gmane.emacs.bugs Subject: bug#20704: info.el bug fix; Interprets Info format wrongly Date: Tue, 09 Jun 2015 13:09:08 +0200 Organization: Recompile Message-ID: <87h9qhf8a3.fsf@tower.recompile.se> References: <87d21gpzle.fsf@tower.recompile.se> <83382btqcc.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1433848225 24542 80.91.229.3 (9 Jun 2015 11:10:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 9 Jun 2015 11:10:25 +0000 (UTC) Cc: 20704@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 09 13:10:16 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z2HQ4-0003FM-AC for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Jun 2015 13:10:12 +0200 Original-Received: from localhost ([::1]:34377 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2HQ3-0003wa-CT for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Jun 2015 07:10:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58787) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2HPz-0003tk-5T for bug-gnu-emacs@gnu.org; Tue, 09 Jun 2015 07:10:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2HPv-0007Cg-V5 for bug-gnu-emacs@gnu.org; Tue, 09 Jun 2015 07:10:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35807) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2HPv-0007Bz-SY for bug-gnu-emacs@gnu.org; Tue, 09 Jun 2015 07:10:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z2HPu-0008Ea-Q5 for bug-gnu-emacs@gnu.org; Tue, 09 Jun 2015 07:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Teddy Hogeborn Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Jun 2015 11:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20704 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 20704-submit@debbugs.gnu.org id=B20704.143384816731604 (code B ref 20704); Tue, 09 Jun 2015 11:10:02 +0000 Original-Received: (at 20704) by debbugs.gnu.org; 9 Jun 2015 11:09:27 +0000 Original-Received: from localhost ([127.0.0.1]:45782 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z2HPK-0008Df-QH for submit@debbugs.gnu.org; Tue, 09 Jun 2015 07:09:27 -0400 Original-Received: from tower.recompile.se ([88.80.28.95]:46534 ident=postfix) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z2HPI-0008DW-SM for 20704@debbugs.gnu.org; Tue, 09 Jun 2015 07:09:25 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by tower.recompile.se (Postfix) with ESMTP id 46D4C36F0C6; Tue, 9 Jun 2015 13:09:23 +0200 (CEST) Original-Received: by tower.recompile.se (Postfix, from userid 1000) id 27F4336D85C; Tue, 9 Jun 2015 13:09:23 +0200 (CEST) In-Reply-To: <83382btqcc.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 01 Jun 2015 18:12:35 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:103763 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Eli Zaretskii writes: > > > + (+ (point-min) (byte-to-position > > > + (read (current-buffer)))) > >=20 > > Hmm... this only works if the Info file is encoded in UTF-8. I > > guess in the case of Info, 99% of the files are just ASCII and > > there's a chance that the vast majority of the rest is (or will be) > > UTF-8, so maybe this hack works well in practice. > > Using byte-to-position would make things worse for Latin-1 and the > likes. No, byte-to-position already checks for that: =2D--- src/marker.c, line 302 /* If this buffer has as many characters as bytes, each character must be one byte. This takes care of the case where enable-multibyte-characters is nil. = */ if (best_above =3D=3D best_above_byte) return bytepos; =2D--- Therefore, an Info file in Latin-1 should work just fine. > But it shouldn't be hard to add a simple test of > buffer-file-coding-system: if it states fixed-size encoding, like any > of the 8-bit encodings, or UTF-16, > the conversion to character position is trivial. I think you mean UTF-32 instead of UTF-16, since UTF-16 is variable- length. /Teddy Hogeborn --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCAAGBQJVdslVAAoJEOubGwHeBXLkjiAP/09dbBj0SdNbVDQMFEf6s9gh IRaRxUBFQ1Q4SlgKF+kjtjL34eboWNVzwtA20qITgkVJbeBw0qZqbUhXikeGVQ2k 7/5eYBXoYv4jqel1rq0gy8h0Ywjp/ktlJLQAi24tfKWStrVH85cQJcp3Rb9Z8rZ9 M940EI6J47/SJzl2OoZ5s1c+RIeOVmRxx1hqjFiT0OVaOTaNSCBR5PNjdMgKF5E+ xgPFmTx3MtY+3MxY92S+W1SuYzkxq5QnYsYtMDk0cY3eI5bzYkvRZFgSP/CLA13r 0hcT2YB6DGwytjCI0c1Zb8TlpAsD6M6/jmY7NejKcpuoHrfu7ncc9r/HJHb+rNlz 8ppdDMZfqj4Rbo/D1sANs7PLOyRlAIh1GDkP//izC306eS+PhmYwpJBRxxl288BQ srUI6Q67J2plsIA/ryC0kCtJQY+na7p/ifZRQVq7kaY70VAT7JK0KOTOoqx6JFHN FLQAmlF7UEyY2fiAj65TI/XNibYPrmRa85LRehDeyBPBjmmEZMgLaXdAjn4i6tOu h0Cm/NUe4Tk3T8nUGxNc2h7fm3gwbxLTCSl5APKWnD/ATzTdQLcHnsVFxfiy/iwV mTRxQfK8auLubxhgdSdvoUu4PkYTBEcSDOXY+dd8oLudkgOkf81ErBSY5swEdXZP 7xvvoJKjRmFSUTvHY2GD =Dt/N -----END PGP SIGNATURE----- --=-=-=--