From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Bernd Paysan via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#37633: Column part interpreted wrong in compilation mode Date: Sat, 05 Oct 2019 19:05:26 +0200 Message-ID: <3214582.DlieoQrNBz@daiyu> References: <2282407.NbK4RY0fEn@daiyu> <83zhif2n0q.fsf@gnu.org> <83y2xz2mmi.fsf@gnu.org> Reply-To: Bernd Paysan Mime-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3431936.ahdLZCUoPY"; micalg="pgp-sha256"; protocol="application/pgp-signature" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="23588"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 37633@debbugs.gnu.org, anton@mips.complang.tuwien.ac.at To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 05 19:32:26 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iGnuo-0005vs-Pg for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Oct 2019 19:32:23 +0200 Original-Received: from localhost ([::1]:58196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iGnun-00051R-G6 for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Oct 2019 13:32:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55301) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iGnuV-00051B-Mv for bug-gnu-emacs@gnu.org; Sat, 05 Oct 2019 13:32:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iGnuU-0001cz-H6 for bug-gnu-emacs@gnu.org; Sat, 05 Oct 2019 13:32:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36319) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iGnuU-0001ct-EV for bug-gnu-emacs@gnu.org; Sat, 05 Oct 2019 13:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iGnuU-0003vp-9k for bug-gnu-emacs@gnu.org; Sat, 05 Oct 2019 13:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Bernd Paysan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Oct 2019 17:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37633 X-GNU-PR-Package: emacs Original-Received: via spool by 37633-submit@debbugs.gnu.org id=B37633.157029666315027 (code B ref 37633); Sat, 05 Oct 2019 17:32:02 +0000 Original-Received: (at 37633) by debbugs.gnu.org; 5 Oct 2019 17:31:03 +0000 Original-Received: from localhost ([127.0.0.1]:45135 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iGntW-0003uD-HW for submit@debbugs.gnu.org; Sat, 05 Oct 2019 13:31:03 -0400 Original-Received: from mail.net2o.de ([185.183.156.191]:54582) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iGnUr-0003Gj-IM for 37633@debbugs.gnu.org; Sat, 05 Oct 2019 13:05:33 -0400 Original-Received: from daiyu.localnet (200116b8262f8d00cce002de63b8a600.dip.versatel-1u1.de [IPv6:2001:16b8:262f:8d00:cce0:2de:63b8:a600]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by mail.net2o.de (Postfix) with ESMTPSA id 32205400A5; Sat, 5 Oct 2019 19:05:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=net2o.de; s=mail; t=1570295131; bh=1z+e6a2/0BG9xZczVBtANxcbrVNqDuiHa7JDf86Xe3c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HXSiT26++yFw9rWqNgZ0khXQ48ea5r9gzW7ltN41m/DyCAUYWnw7xq1p1pTgO4Rko 77tSHnYKDczErYrcMSE2Scf05TkuUnuHWQUDl47Q1kGqTl9XPm0EYylTuAnjeNNt7s Pij6cQJINM1mCUVsmKoCfT+yT4FzI2J4VWI0VigE= In-Reply-To: <83y2xz2mmi.fsf@gnu.org> X-Mailman-Approved-At: Sat, 05 Oct 2019 13:31:01 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:168388 Archived-At: --nextPart3431936.ahdLZCUoPY Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Am Samstag, 5. Oktober 2019, 18:16:53 CEST schrieb Eli Zaretskii: > > Date: Sat, 05 Oct 2019 19:08:21 +0300 > > From: Eli Zaretskii > > Cc: 37633@debbugs.gnu.org, anton@mips.complang.tuwien.ac.at > > > > > Suggested solution: Use byte-to-position to calculate the position in > > > compilation-move-to-column. > > > > This only works in UTF-8 locales, and is not 100% even there, so it > > isn't the right solution. > > In general, byte-to-position is meant to be used only for converting > between byte and character positions of text in Emacs buffers. > > For byte offsets in external text we have bufferpos-to-filepos, but > that requires us to know the encoding of the external text. We need > to find a reasonable way of getting that. Suggestions and patches > welcome. We can likely assume that the auto-detected encoding is the correct one, i.e. buffer-file-coding-system can be used (the default for the optional encoding system parameter for bufferpos-to-filepos and filepos-to-bufferpos). I.e. go to the line selected, do a bufferpos-to-filepos on that position, add the column-1 to that, and do a filepos-to-bufferpos. Jump there. Problem with precision: "exact" requires encoding the entire file, so it's slow for large files. Particularly with automatically generated files, this is likely not acceptable, so "approximate" could be good enough. -- Bernd Paysan "If you want it done right, you have to do it yourself" net2o id: kQusJzA;7*?t=uy@X}1GWr!+0qqp_Cn176t4(dQ* https://net2o.de/ --nextPart3431936.ahdLZCUoPY Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEERJ1NDqPQRwYnwBjr9y2Uk5MtoGcFAl2YzVYACgkQ9y2Uk5Mt oGekPA//Q+nKvD2DJHBh6YgISZFS+tiq87nmjECwtsYDURvgLz8DMvLMSYN02czK g/oMU8oWQ4Ea783DTCdaNP2dyxFwIHlIw/ZGb/a1WKbGqEfpVrH1L+oGhWrjrAcx 3RaAHp+eg44c3YbQR/JKkyDjVL9CkkFc3kAseFN2WS45U/ucfnB/YzUktK9CKYwk ens+Y0dvOJgpfI5tgF8fRrTY7iwA3HMpsm5aSjoLeHhHngG+pwOiV839/sWHVrQQ GKt8VQBuosCJ00jF0IyMxw/ngHD15KKPYT7lHDqi9DAJtkdIKsiWkzpRTKMgvrfe sb/JbeC/4iQYJwctufr17Xt86/y43+K3YXE/iq513eu+VOxvs9KX+ukYjR2vbLcL SsaLF4LO9L7HrUcAJ6EWR0MiAOD2XA/DFabEZkKEbqLRp5Vgg4H6bV2TGhL6q5kY 5ZLdAv9CJR+yvpZNIeAKmMbgJ4qTyCij6BhG+pC+5ygvmTWz7eazKF2x0v8uPx0r SUnY1mo6WvJnUQNEvjbS4Y1dyZqHsfAV/RhpC1iCHx19OxKZ+3O9Mhavu/Qv1Q04 ZhDUYosAKOqRc1dZ9a1820qBqB64EpXIcAY9dhLn2v4fS+VSCgvK1WNyrYV+uEUq NLcEAqj8uDcbwTw6a/NJGdipDj6+Asw0IF6Uz0CVtyzWfH3cdUI= =pify -----END PGP SIGNATURE----- --nextPart3431936.ahdLZCUoPY--