GNU bug report logs - #37633
Column part interpreted wrong in compilation mode

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Bernd Paysan <bernd@HIDDEN>; dated Sat, 5 Oct 2019 15:45:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 37633 <at> debbugs.gnu.org:


Received: (at 37633) by debbugs.gnu.org; 7 Oct 2019 07:09:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 07 03:09:13 2019
Received: from localhost ([127.0.0.1]:47321 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iHN8r-0006Fn-GE
	for submit <at> debbugs.gnu.org; Mon, 07 Oct 2019 03:09:13 -0400
Received: from a4.complang.tuwien.ac.at ([128.130.173.65]:58756)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <anton@HIDDEN>)
 id 1iHN8o-0006Fd-M2
 for 37633 <at> debbugs.gnu.org; Mon, 07 Oct 2019 03:09:11 -0400
Received: from anton by a4 with local (Exim 4.89)
 (envelope-from <anton@HIDDEN>)
 id 1iHN8m-0004CQ-As; Mon, 07 Oct 2019 09:09:08 +0200
Date: Mon, 7 Oct 2019 09:09:08 +0200
From: Anton Ertl <anton@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#37633: Column part interpreted wrong in compilation mode
Message-ID: <20191007070908.gul34vy2rz5lkl4f@HIDDEN>
References: <2282407.NbK4RY0fEn@daiyu> <83zhif2n0q.fsf@HIDDEN>
 <83y2xz2mmi.fsf@HIDDEN>
 <20191006123112.ej2heyy2qudfcvep@HIDDEN>
 <831rvp3glu.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <831rvp3glu.fsf@HIDDEN>
User-Agent: NeoMutt/20170113 (1.7.2)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 37633
Cc: anton@HIDDEN, bernd@HIDDEN, 37633 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: anton@HIDDEN
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Sun, Oct 06, 2019 at 08:53:49PM +0300, Eli Zaretskii wrote:
> > the byte position does not depend on the encoding (unlike the
> > character position).
> 
> ??? The same Latin-1 characters encoded in ISO-8859-1 and in UTF-8
> will yield a different number of bytes.  So I don't think I understand
> how can you say the above.

The same bytes have the same number of bytes, whether you interpret
them as having one encoding or some other encoding.  How many
characters these bytes have depends on the encoding.

Of course, if you have transcoded the bytes into some other encoding,
you have to transcode them back for counting.  So for Emacs this means
converting back to the input encoding, and then counting (i.e., what
you describe as TRT (which I guess means The Right Thing)).

- anton




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37633; Package emacs. Full text available.

Message received at 37633 <at> debbugs.gnu.org:


Received: (at 37633) by debbugs.gnu.org; 6 Oct 2019 19:36:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 06 15:36:04 2019
Received: from localhost ([127.0.0.1]:46914 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iHCK4-00037c-6R
	for submit <at> debbugs.gnu.org; Sun, 06 Oct 2019 15:36:04 -0400
Received: from mail.net2o.de ([185.183.156.191]:55964)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bernd@HIDDEN>) id 1iHCK2-00037G-Ef
 for 37633 <at> debbugs.gnu.org; Sun, 06 Oct 2019 15:36:02 -0400
Received: from daiyu.localnet
 (200116b826959f009a939674d530470e.dip.versatel-1u1.de
 [IPv6:2001:16b8:2695:9f00:9a93:9674:d530:470e])
 (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 88FBF400A6;
 Sun,  6 Oct 2019 21:36:01 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=net2o.de; s=mail;
 t=1570390561; bh=SdSUGe9jWUOJ77fHRnRmWlv7sc5T3fZhZUF6D3LM0Gs=;
 h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
 b=Pqjn9FZQTX864CDxaBw0u6MVr1qAIcIhpdT1l/1tLA1XwtDgGgdm4y2dslGkSrHAK
 VGWYK8mkZJcxx/85X3rIDVhIgiMXDCQ58aEKM5GyjPV3Ao3iqi500PV489lyWg613h
 xW3p+iTE1A/XrgXyNE6EWTteP20s/lNxejB5OVhg=
From: Bernd Paysan <bernd@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#37633: Column part interpreted wrong in compilation mode
Date: Sun, 06 Oct 2019 21:35:57 +0200
Message-ID: <1635762.KEO93YaQZ2@daiyu>
In-Reply-To: <83a7ad1xe0.fsf@HIDDEN>
References: <2282407.NbK4RY0fEn@daiyu> <13778688.nWSaQooa0N@daiyu>
 <83a7ad1xe0.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart11550329.iLgqfV9UAB";
 micalg="pgp-sha256"; protocol="application/pgp-signature"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 37633
Cc: anton@HIDDEN, 37633 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--nextPart11550329.iLgqfV9UAB
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"

Am Sonntag, 6. Oktober 2019, 21:34:15 CEST schrieb Eli Zaretskii:
> Not sure I understand: are you saying that your experiment proves that
> my assertion about the number of bytes was incorrect?  Because it
> doesn't.

No, the experiment supports your assertion.

> And anyway, I see n o reason to argue about this side issue, since we
> seem to be in agreement that using the file's encoding is TRT.

Indeed. Use the file's encoding is TRT.

-- 
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/

--nextPart11550329.iLgqfV9UAB
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part.
Content-Transfer-Encoding: 7Bit

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEERJ1NDqPQRwYnwBjr9y2Uk5MtoGcFAl2aQh0ACgkQ9y2Uk5Mt
oGcKOQ/+Okw+DwAp1d0qyzEN7g+RPRRwtzngzP9Z0tbeA62sAt2Ygo6DA7Pps6T6
Wj4LJdNS8GN3xJ1cVMfVwcuJaxihBmO6Gbo90ckr2CuO0L6n/1tP++f4wZDz1waU
IeRyRtaDJo7iisa1J64t+Rz7YRt2PFBxYHawq4DFrBvM28oI3uCkXWiLnD93YvH1
Ef+SBdRB+J33E/S0+/818om591e9d9XNgF/wm2v3mAxQaooQlKHgHSJ7r9DHwl4j
VHuJd33gUinHgImwMi3oelX/Bav7SKa3/Ezvko6uY3sI0cVWiyZ5RdZolneywCd6
ug6SL6+YACsGYCXneEJ86X+cXg+RXMlH0OveXY/8opkRNv8aJiquvKX8j58p3GTj
2PgG9QQY7StySU5c5bIzZi6eg9P/SYq5gP359jhDhW2nGj/0ZG0/kaxZR4mwM7C7
cN4mXl7XO6h3Xyc3r8ozVLquvtKczc3bSap0Fo0KyvQQq0zsVB/bkjnE8QJg6l7d
o4TTOkH9rH+ERwuYjuDJAmK0cjccyKQxBQ4IThlLyCtDofyqhbucGRXqXL+/LSHQ
hEUPLC9dUO0n+nl6Bllz8hGxvzy3EiaYYLCdKSG4VMmiiuyEHyqFAmsH/38DYXZS
Rw2Yyq7Th2mUZj+L3xIZqrPOxf6UAAThEOronxBEAIKxZ2ZKHTQ=
=Bi4A
-----END PGP SIGNATURE-----

--nextPart11550329.iLgqfV9UAB--







Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37633; Package emacs. Full text available.

Message received at 37633 <at> debbugs.gnu.org:


Received: (at 37633) by debbugs.gnu.org; 6 Oct 2019 19:34:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 06 15:34:40 2019
Received: from localhost ([127.0.0.1]:46910 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iHCIh-00034p-Os
	for submit <at> debbugs.gnu.org; Sun, 06 Oct 2019 15:34:40 -0400
Received: from eggs.gnu.org ([209.51.188.92]:46490)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1iHCIf-00034Z-4y
 for 37633 <at> debbugs.gnu.org; Sun, 06 Oct 2019 15:34:37 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:34664)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1iHCIW-00087W-Mr; Sun, 06 Oct 2019 15:34:30 -0400
Received: from [176.228.60.248] (port=1296 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1iHCIV-0000OP-BU; Sun, 06 Oct 2019 15:34:28 -0400
Date: Sun, 06 Oct 2019 22:34:15 +0300
Message-Id: <83a7ad1xe0.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Bernd Paysan <bernd@HIDDEN>
In-reply-to: <13778688.nWSaQooa0N@daiyu> (message from Bernd Paysan on Sun, 06
 Oct 2019 21:22:20 +0200)
Subject: Re: bug#37633: Column part interpreted wrong in compilation mode
References: <2282407.NbK4RY0fEn@daiyu> <7240153.3ZlepMpCQE@daiyu>
 <83eezp1y74.fsf@HIDDEN> <13778688.nWSaQooa0N@daiyu>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 37633
Cc: anton@HIDDEN, 37633 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Bernd Paysan <bernd@HIDDEN>
> Cc: anton@HIDDEN, 37633 <at> debbugs.gnu.org
> Date: Sun, 06 Oct 2019 21:22:20 +0200
> 
> > > if the editor mistook a UTF-8 file for an iso8859-1, it will see an
> > > UTF-8 string "äöü" (6 bytes UTF-8) as "äöü" (6 bytes iso8859-1).
> > > But it's still 6 bytes.
> > 
> > Not inside the Emacs buffer, it isn't.
> 
> I created a unicode file:
> [...]
> If I revert this buffer with the correct encoding utf-8-unix, then it still 
> navigates to the i of %i, so it's all agnostic to whether the encoding 
> detected was correct or wrong.

Not sure I understand: are you saying that your experiment proves that
my assertion about the number of bytes was incorrect?  Because it
doesn't.

And anyway, I see n o reason to argue about this side issue, since we
seem to be in agreement that using the file's encoding is TRT.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37633; Package emacs. Full text available.

Message received at 37633 <at> debbugs.gnu.org:


Received: (at 37633) by debbugs.gnu.org; 6 Oct 2019 19:22:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 06 15:22:27 2019
Received: from localhost ([127.0.0.1]:46905 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iHC6t-0002j6-HY
	for submit <at> debbugs.gnu.org; Sun, 06 Oct 2019 15:22:27 -0400
Received: from mail.net2o.de ([185.183.156.191]:53774)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bernd@HIDDEN>) id 1iHC6r-0002iw-L4
 for 37633 <at> debbugs.gnu.org; Sun, 06 Oct 2019 15:22:26 -0400
Received: from daiyu.localnet
 (200116b826959f009a939674d530470e.dip.versatel-1u1.de
 [IPv6:2001:16b8:2695:9f00:9a93:9674:d530:470e])
 (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 55558400A4;
 Sun,  6 Oct 2019 21:22:24 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=net2o.de; s=mail;
 t=1570389744; bh=Whye8hHOqTh3FmBkcqLym4bKAdQIrbFV608qBv1Y9O0=;
 h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
 b=X/eKlC6diOdc27O37nb70iRzbjsdr5rwfmyr2PenKuh3ExpoT05jVy8uB4DvRnvck
 VHI5qrHcZJNmsiZ2AiG4lKNJ3SegLBKMGWK+3R0ryR/pMWN1zfWErLSNaW3q2jlPcY
 u5b+YDIZOhiKA2QQ26xhYNwBLG163M0/33Tjhvzo=
From: Bernd Paysan <bernd@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#37633: Column part interpreted wrong in compilation mode
Date: Sun, 06 Oct 2019 21:22:20 +0200
Message-ID: <13778688.nWSaQooa0N@daiyu>
In-Reply-To: <83eezp1y74.fsf@HIDDEN>
References: <2282407.NbK4RY0fEn@daiyu> <7240153.3ZlepMpCQE@daiyu>
 <83eezp1y74.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart157042314.ShjI78uFIE";
 micalg="pgp-sha256"; protocol="application/pgp-signature"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 37633
Cc: anton@HIDDEN, 37633 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--nextPart157042314.ShjI78uFIE
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"

Am Sonntag, 6. Oktober 2019, 21:16:47 CEST schrieb Eli Zaretskii:
> > From: Bernd Paysan <bernd@HIDDEN>
> > Cc: anton@HIDDEN, 37633 <at> debbugs.gnu.org
> > Date: Sun, 06 Oct 2019 21:02:14 +0200
> >=20
> > if the editor mistook a UTF-8 file for an iso8859-1, it will see an
> > UTF-8 string "=C3=A4=C3=B6=C3=BC" (6 bytes UTF-8) as "=C3=83=C2=A4=C3=
=83=C2=B6=C3=83=C2=BC" (6 bytes iso8859-1).
> > But it's still 6 bytes.
>=20
> Not inside the Emacs buffer, it isn't.

I created a unicode file:

void main() {
        char *b=3D"ha", *c=3D"ho";
        printf("test %i", b);
        printf("test=C3=A4=C3=B6=C3=BC %i", c);
}

I loaded this into emacs, and reverted the buffer using iso8859-1 coding=20
(simulating a wrongly detected encoding).

It then looks like this:

void main() {
	char *b=3D"ha", *c=3D"ho";
	printf("test %i", b);
	printf("test=C3=83=C2=A4=C3=83=C2=B6=C3=83=C2=BC %i", c);
}

I compiled it with gcc -Wall test-utf8.c into a compile-mode buffer.

=2D*- mode: compilation; default-directory: "~/tmp/" -*-
Compilation started at Sun Oct  6 21:18:24

gcc -Wall test-utf.c=20
test-utf.c:1:6: warning: return type of =E2=80=98main=E2=80=99 is not =E2=
=80=98int=E2=80=99 [-Wmain]
    1 | void main() {
      |      ^~~~
test-utf.c: In function =E2=80=98main=E2=80=99:
test-utf.c:3:2: warning: implicit declaration of function =E2=80=98printf=
=E2=80=99 [-
Wimplicit-function-declaration]
    3 |  printf("test %i", b);
      |  ^~~~~~
test-utf.c:3:2: warning: incompatible implicit declaration of built-in=20
function =E2=80=98printf=E2=80=99
test-utf.c:1:1: note: include =E2=80=98<stdio.h>=E2=80=99 or provide a decl=
aration of =E2=80=98printf=E2=80=99
  +++ |+#include <stdio.h>
    1 | void main() {
test-utf.c:3:16: warning: format =E2=80=98%i=E2=80=99 expects argument of t=
ype =E2=80=98int=E2=80=99, but=20
argument 2 has type =E2=80=98char *=E2=80=99 [-Wformat=3D]
    3 |  printf("test %i", b);
      |               ~^   ~
      |                |   |
      |                int char *
      |               %s
test-utf.c:4:22: warning: format =E2=80=98%i=E2=80=99 expects argument of t=
ype =E2=80=98int=E2=80=99, but=20
argument 2 has type =E2=80=98char *=E2=80=99 [-Wformat=3D]
    4 |  printf("test=C3=A4=C3=B6=C3=BC %i", c);
      |                     ~^   ~
      |                      |   |
      |                      int char *
      |                     %s

Compilation finished at Sun Oct  6 21:18:24

If I click on the test-utf.c:4:22 label, I get exactly where I want to: On =
the=20
i of %i.

If I revert this buffer with the correct encoding utf-8-unix, then it still=
=20
navigates to the i of %i, so it's all agnostic to whether the encoding=20
detected was correct or wrong.

=2D-=20
Bernd Paysan
"If you want it done right, you have to do it yourself"
net2o id: kQusJzA;7*?t=3Duy@X}1GWr!+0qqp_Cn176t4(dQ*
https://net2o.de/

--nextPart157042314.ShjI78uFIE
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part.
Content-Transfer-Encoding: 7Bit

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEERJ1NDqPQRwYnwBjr9y2Uk5MtoGcFAl2aPuwACgkQ9y2Uk5Mt
oGfPKw//Qc5EBYXHJaKr5E1AH0tstzyzHJCPLLhssU99ieMHX8tgoLKgfQaC0AYS
mykOrbXTnTBluvUw40DHWmG6P0RBiZ/vJ/sUVBr1WQ7Sw3zbh9+2kq6qT+wPToSU
w7diL3gXxnfqFMNtR7Fq6/5ZOtf9Dh9zjdwwNjWuSvRWhwsNKPnGdFX10phzdaKJ
8znzlZlrZFcpFyuUtdbkGIQHWk7uPaIZaBxuaRN4eTuAm1UbkPiLPUGdHTFsLZDx
RVHOFO0ImTiy0soG+gACF2txsyf7eSjTgN9T13FJtV+nqGOlpZXO7h+z2Zhke1lh
iCc/C/mf9Jb/mSIf4AgowKMVPrKkIOXRTcH3C525wup9tChZ0zkhDr9iZXwJW2xU
9ttnA5MESc17bzPr4lAuoguQQNUgDX8sJbTDQWrE8VvG+a0VmCQtqpz4TjaLmhU0
npO945O/qXDAlsewWkCaiPTrJjopjIGSMtmpOB0TztAH7zfGODxIR31kZ/4jtOxi
vcaeSWAKy9sOG4pXoA21Ow0PQBYD4Nb8gdURCprPtO24AZsdPHiIeq2mUlN9WltE
cOSHps1hSKJXEUpMpcFFl2a3nCkCgIEBmFwoiI3plSXgsdiMHn4tJ7SCcI0oqyDI
A47c6bsBECy4g8ueaSj+k+vQ5tk0OI9/QllLHMWgst/UtbZirtw=
=Ta0r
-----END PGP SIGNATURE-----

--nextPart157042314.ShjI78uFIE--







Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37633; Package emacs. Full text available.

Message received at 37633 <at> debbugs.gnu.org:


Received: (at 37633) by debbugs.gnu.org; 6 Oct 2019 19:17:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 06 15:17:02 2019
Received: from localhost ([127.0.0.1]:46892 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iHC1e-0002Zn-9T
	for submit <at> debbugs.gnu.org; Sun, 06 Oct 2019 15:17:02 -0400
Received: from eggs.gnu.org ([209.51.188.92]:43879)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1iHC1c-0002ZH-69
 for 37633 <at> debbugs.gnu.org; Sun, 06 Oct 2019 15:17:00 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:34344)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1iHC1V-00084B-Uv; Sun, 06 Oct 2019 15:16:53 -0400
Received: from [176.228.60.248] (port=4150 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1iHC1V-0006vu-CI; Sun, 06 Oct 2019 15:16:53 -0400
Date: Sun, 06 Oct 2019 22:16:47 +0300
Message-Id: <83eezp1y74.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Bernd Paysan <bernd@HIDDEN>
In-reply-to: <7240153.3ZlepMpCQE@daiyu> (message from Bernd Paysan on Sun, 06
 Oct 2019 21:02:14 +0200)
Subject: Re: bug#37633: Column part interpreted wrong in compilation mode
References: <2282407.NbK4RY0fEn@daiyu>
 <20191006123112.ej2heyy2qudfcvep@HIDDEN>
 <831rvp3glu.fsf@HIDDEN> <7240153.3ZlepMpCQE@daiyu>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 37633
Cc: anton@HIDDEN, 37633 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Bernd Paysan <bernd@HIDDEN>
> Cc: anton@HIDDEN, 37633 <at> debbugs.gnu.org
> Date: Sun, 06 Oct 2019 21:02:14 +0200
> 
> if the editor mistook a UTF-8 file for an iso8859-1, it will see an
> UTF-8 string "äöü" (6 bytes UTF-8) as "äöü" (6 bytes iso8859-1).
> But it's still 6 bytes.

Not inside the Emacs buffer, it isn't.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37633; Package emacs. Full text available.

Message received at 37633 <at> debbugs.gnu.org:


Received: (at 37633) by debbugs.gnu.org; 6 Oct 2019 19:16:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 06 15:16:50 2019
Received: from localhost ([127.0.0.1]:46888 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iHC1R-0002Z3-V6
	for submit <at> debbugs.gnu.org; Sun, 06 Oct 2019 15:16:50 -0400
Received: from mail.net2o.de ([185.183.156.191]:52904)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bernd@HIDDEN>) id 1iHC1P-0002Yv-Pn
 for 37633 <at> debbugs.gnu.org; Sun, 06 Oct 2019 15:16:48 -0400
Received: from daiyu.localnet
 (200116b826959f009a939674d530470e.dip.versatel-1u1.de
 [IPv6:2001:16b8:2695:9f00:9a93:9674:d530:470e])
 (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 8E411400A4;
 Sun,  6 Oct 2019 21:16:46 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=net2o.de; s=mail;
 t=1570389406; bh=dHoGFL/r9Bk4PjA+ua7JP61YkRvlCkjRYmOrNa9wY6U=;
 h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
 b=Vmr5RNvTrDURkajagdIg7uzaHNESSeFQqiaTWRrR74kcIiHcYsT687Khc+mm3k+Uc
 Mfly1AdoJ230DJ1SBuHlKskXixyInh1ylCN7k6BHyhHJ+MbHgU9Lh/59vG9R9qqAMO
 2QGDQZYNoWunOAVUxsTXG+2qQS8kMVoYKyPIj2Lk=
From: Bernd Paysan <bernd@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#37633: Column part interpreted wrong in compilation mode
Date: Sun, 06 Oct 2019 21:16:42 +0200
Message-ID: <1647726.HKmsaYjO2t@daiyu>
In-Reply-To: <83mued1z8b.fsf@HIDDEN>
References: <2282407.NbK4RY0fEn@daiyu> <1695563.6luOslTFfj@daiyu>
 <83mued1z8b.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart2977562.UjiSLNUvdj";
 micalg="pgp-sha256"; protocol="application/pgp-signature"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 37633
Cc: 37633 <at> debbugs.gnu.org, anton@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--nextPart2977562.UjiSLNUvdj
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"

Am Sonntag, 6. Oktober 2019, 20:54:28 CEST schrieb Eli Zaretskii:
> > From: Bernd Paysan <bernd@HIDDEN>
> > Cc: 37633 <at> debbugs.gnu.org, anton@HIDDEN
> > Date: Sun, 06 Oct 2019 19:35:33 +0200
> > 
> > It counts bytes in its input.
> 
> In that case, using the encoding with which we visited the source is
> TRT.

Yes.

-- 
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/

--nextPart2977562.UjiSLNUvdj
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part.
Content-Transfer-Encoding: 7Bit

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEERJ1NDqPQRwYnwBjr9y2Uk5MtoGcFAl2aPZoACgkQ9y2Uk5Mt
oGeV6hAAgUG9ikfGJD/nfy1QybpnZYsWTVkFlWqNHTJ0ld37e9gpnwWLxop4pvCz
FHgivi5Wb6NO+mR6RXLbRVp7iGuEg17o3KoUMPKBcNc0kgShYB+BF9on+6eixH5w
EyUKhxR7PfZoE3lY0dwm+No+symBhjkgZvXakqddSgMZ/sPOBeBVHgBCjoNt/Qin
Ua/QhV+Zx29Ksz3J4K8aGVrLF9vAd2ZIfqVVTsYYfPAovkY+X5SEw8ME9DZnTGKL
Uj15xQ98vNjBci72Hs8G8xb9TuYyghrBFt7V3BhpuvmQWyTlsDXCvUOZgayVTZhZ
LZZ9iB2K/f/sNISeBM9z7wDv0cXZ5RQ4kErmjtxu5iVsrdesm5leH8YX5x7GhPsM
IhLYd571ZWzyPsz2gYJCgvRBZf4LF7PdD8N1gDFpa+cUXOcp+0uvcOCeQuDhwatG
gLm/m1Q7JvXce2woqTFs6pVqjuO7DtwjVt0xdPnfDhyZFn7YH7Wp4c+E5MsmXKYW
ca6ahFKzSBWyZGOP0/gfGiNdzyYzWwJ5J00IxKmiz7sKmRqNJiAuKnC7mfYpTNF3
MTUAU/c/POD1q+MquLNP16nCk10vG5re/Gs008d6CyA3GrQs0WqQCNr7Z7sRWfmk
VKPKYkrK+PVEoLS+ZJVJ03LU/FCZPh2k6UPJQEUcL+6Dz8aDs20=
=rBLp
-----END PGP SIGNATURE-----

--nextPart2977562.UjiSLNUvdj--







Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37633; Package emacs. Full text available.

Message received at 37633 <at> debbugs.gnu.org:


Received: (at 37633) by debbugs.gnu.org; 6 Oct 2019 19:02:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 06 15:02:22 2019
Received: from localhost ([127.0.0.1]:46880 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iHBnS-0002B3-GT
	for submit <at> debbugs.gnu.org; Sun, 06 Oct 2019 15:02:22 -0400
Received: from mail.net2o.de ([185.183.156.191]:50400)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bernd@HIDDEN>) id 1iHBnQ-0002At-56
 for 37633 <at> debbugs.gnu.org; Sun, 06 Oct 2019 15:02:21 -0400
Received: from daiyu.localnet
 (200116b826959f009a939674d530470e.dip.versatel-1u1.de
 [IPv6:2001:16b8:2695:9f00:9a93:9674:d530:470e])
 (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 B8AE3400A4;
 Sun,  6 Oct 2019 21:02:18 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=net2o.de; s=mail;
 t=1570388538; bh=vVGEoOrkvRsAGdG+krJmx2C/NCPvh3n/f5oetfLR6Co=;
 h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
 b=RqiX2G91JQC8ZaZA0t2TnpfbB92tlZBal7MStvxXv00ioIxtqc+XXYz0USD38lN1a
 o+RR64uYRE9tyu1jmcNWo8MTede1OdUyxv/y/27Zsseaca04UqwDgh6TERvBS77aBe
 yxhSqykIFmaRHqKCqyBMg5E3YyFeuU9SxhOjPqZs=
From: Bernd Paysan <bernd@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#37633: Column part interpreted wrong in compilation mode
Date: Sun, 06 Oct 2019 21:02:14 +0200
Message-ID: <7240153.3ZlepMpCQE@daiyu>
In-Reply-To: <831rvp3glu.fsf@HIDDEN>
References: <2282407.NbK4RY0fEn@daiyu>
 <20191006123112.ej2heyy2qudfcvep@HIDDEN>
 <831rvp3glu.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart21515511.aIRQMYrt1L";
 micalg="pgp-sha256"; protocol="application/pgp-signature"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 37633
Cc: anton@HIDDEN, 37633 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--nextPart21515511.aIRQMYrt1L
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"

Am Sonntag, 6. Oktober 2019, 19:53:49 CEST schrieb Eli Zaretskii:
> > Date: Sun, 6 Oct 2019 14:31:12 +0200
> > From: Anton Ertl <anton@HIDDEN>
> > Cc: bernd@HIDDEN, 37633 <at> debbugs.gnu.org,
> > anton@HIDDEN
> >=20
> > On Sat, Oct 05, 2019 at 07:16:53PM +0300, Eli Zaretskii wrote:
> > > 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.
> >=20
> > It's the encoding that you assumed for the text when you loaded the
> > file into the buffer.
>=20
> I'm not sure this is correct.  You are saying that the compiler counts
> bytes in the original file, not in its output (which might be encoded
> differently).  Do we have conclusive evidence that this is always
> true?

Almost always.  gcc has a gazillion of options almost nobody uses.

E.g., you can use -finput-encoding=3D<endoding> to transcode input files on=
=20
reading.  It's a not well tested option, as the output (still iso8859-1)=20
shows:

% gcc -finput-charset=3Diso8859-1 test-iso.c
test-iso.c: In function =E2=80=98foo=E2=80=99:
test-iso.c:2:2: warning: implicit declaration of function =E2=80=98printf=
=E2=80=99 [-
Wimplicit-function-declaration]
    2 |  printf("test %i", b);
      |  ^~~~~~
test-iso.c:2:2: warning: incompatible implicit declaration of built-in=20
function =E2=80=98printf=E2=80=99
test-iso.c:1:1: note: include =E2=80=98<stdio.h>=E2=80=99 or provide a decl=
aration of =E2=80=98printf=E2=80=99
  +++ |+#include <stdio.h>
    1 | void foo() {
test-iso.c:2:20: error: =E2=80=98b=E2=80=99 undeclared (first use in this f=
unction)
    2 |  printf("test %i", b);
      |                    ^
test-iso.c:2:20: note: each undeclared identifier is reported only once for=
=20
each function it appears in
test-iso.c:3:26: error: =E2=80=98c=E2=80=99 undeclared (first use in this f=
unction)
    3 |  printf("test=EF=BF=BD=EF=BF=BD=EF=BF=BD %i", c);
      |                          ^

Here, due to the conversion on read in, the position reported is different =
(it=20
was 3:23 before).

This transparent conversion on reading is used rarely.  Or rather: There is=
 no=20
search result in the entire github database.

> > the byte position does not depend on the encoding (unlike the
> > character position).
>=20
> ??? The same Latin-1 characters encoded in ISO-8859-1 and in UTF-8
> will yield a different number of bytes.  So I don't think I understand
> how can you say the above.

What I'm trying to tell: The compiler (unless instructed to convert the fil=
e=20
on reading) reports the byte position it found in the file.  That's the sam=
e=20
byte position the editor calculates for that file =E2=80=94 and that is reg=
ardless of=20
what the editor assumed as encoding.  I.e. if the editor mistook a UTF-8 fi=
le=20
for an iso8859-1, it will see an UTF-8 string "=C3=A4=C3=B6=C3=BC" (6 bytes=
 UTF-8) as=20
"=C3=83=C2=A4=C3=83=C2=B6=C3=83=C2=BC" (6 bytes iso8859-1).  But it's still=
 6 bytes.

=2D-=20
Bernd Paysan
"If you want it done right, you have to do it yourself"
net2o id: kQusJzA;7*?t=3Duy@X}1GWr!+0qqp_Cn176t4(dQ*
https://net2o.de/

--nextPart21515511.aIRQMYrt1L
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part.
Content-Transfer-Encoding: 7Bit

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEERJ1NDqPQRwYnwBjr9y2Uk5MtoGcFAl2aOjYACgkQ9y2Uk5Mt
oGdS0BAAjNc3rQJMAUAILGZDebL4QBrNjAJaOUHEiKuBmBC5M3a5Jg6YdJKK/1/T
3gO+frn+eaU9m7w8dlsRwBILhUyEm92zUfasgsiC/JvjlOY3aT48GmR4munbWk0T
1uTzTxSa/8EeG++3HweBJ8NYIuvNvDxxKgtpxlZXwSnBfqxP8SR2X7f7nkA1/JA+
NgMKqQphy7+YuIrri2zXwx9RIy9UJMxT3r7jFHz2inz23WRy6Ol/svMObe816CZo
UVLtP56YYobZ32iLFCWOjlHpS2iM/hMZ0dsteUO59XFJ/eE0w/5XloZqELOHhiPy
M9ucuPNDwpU8Jh8ZQAmLXPnPz++5fPaU9DuTRQMT311fsBVBYCHhyrZXCx9iORKv
tr1RuLlJbOGHWkzDEKYjQaJOwPVT9pvzL4u++1oDIJhZzUy3cd0+MrczKoghQHX0
7lKGqPOjxFno7ABUShq/5DA/h5shm8kxJpG9/0GsxQiD7YHbF9ep2Usphbtu1bjw
sik4cgEQeU1YGVtM5n1WG2RCx+YSCWV7kWE/7gWgtw6jGLbq7UbyaGsXFszZML2E
N5lLvzdxophhX5YMjeO9f7XaIyqcpUG+ljmjSGXxJsoK/d6sjgmbw0cGSg+ptZ7p
Q6L+DItB049QvVGi9J7BOScchAvUeKlKbOKMhYhygY2hDZXXShI=
=DtR9
-----END PGP SIGNATURE-----

--nextPart21515511.aIRQMYrt1L--







Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37633; Package emacs. Full text available.

Message received at 37633 <at> debbugs.gnu.org:


Received: (at 37633) by debbugs.gnu.org; 6 Oct 2019 18:54:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 06 14:54:57 2019
Received: from localhost ([127.0.0.1]:46861 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iHBgG-0001vi-NC
	for submit <at> debbugs.gnu.org; Sun, 06 Oct 2019 14:54:56 -0400
Received: from eggs.gnu.org ([209.51.188.92]:40036)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1iHBgE-0001vS-SE
 for 37633 <at> debbugs.gnu.org; Sun, 06 Oct 2019 14:54:55 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:34026)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1iHBg7-0006sc-VY; Sun, 06 Oct 2019 14:54:48 -0400
Received: from [176.228.60.248] (port=2782 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1iHBg5-0004bP-Hy; Sun, 06 Oct 2019 14:54:47 -0400
Date: Sun, 06 Oct 2019 21:54:28 +0300
Message-Id: <83mued1z8b.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Bernd Paysan <bernd@HIDDEN>
In-reply-to: <1695563.6luOslTFfj@daiyu> (message from Bernd Paysan on Sun, 06
 Oct 2019 19:35:33 +0200)
Subject: Re: bug#37633: Column part interpreted wrong in compilation mode
References: <2282407.NbK4RY0fEn@daiyu> <1734660.yQRGRn46K7@daiyu>
 <83h84l3ibo.fsf@HIDDEN> <1695563.6luOslTFfj@daiyu>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 37633
Cc: 37633 <at> debbugs.gnu.org, anton@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Bernd Paysan <bernd@HIDDEN>
> Cc: 37633 <at> debbugs.gnu.org, anton@HIDDEN
> Date: Sun, 06 Oct 2019 19:35:33 +0200
> 
> It counts bytes in its input.

In that case, using the encoding with which we visited the source is
TRT.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37633; Package emacs. Full text available.

Message received at 37633 <at> debbugs.gnu.org:


Received: (at 37633) by debbugs.gnu.org; 6 Oct 2019 17:54:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 06 13:54:21 2019
Received: from localhost ([127.0.0.1]:46820 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iHAjc-0000GQ-P4
	for submit <at> debbugs.gnu.org; Sun, 06 Oct 2019 13:54:20 -0400
Received: from eggs.gnu.org ([209.51.188.92]:60218)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1iHAja-0000GC-IY
 for 37633 <at> debbugs.gnu.org; Sun, 06 Oct 2019 13:54:19 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:32891)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1iHAjT-0003Um-V9; Sun, 06 Oct 2019 13:54:11 -0400
Received: from [176.228.60.248] (port=3069 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1iHAjR-0006ye-9G; Sun, 06 Oct 2019 13:54:11 -0400
Date: Sun, 06 Oct 2019 20:53:49 +0300
Message-Id: <831rvp3glu.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: anton@HIDDEN
In-reply-to: <20191006123112.ej2heyy2qudfcvep@HIDDEN>
 (message from Anton Ertl on Sun, 6 Oct 2019 14:31:12 +0200)
Subject: Re: bug#37633: Column part interpreted wrong in compilation mode
References: <2282407.NbK4RY0fEn@daiyu> <83zhif2n0q.fsf@HIDDEN>
 <83y2xz2mmi.fsf@HIDDEN>
 <20191006123112.ej2heyy2qudfcvep@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 37633
Cc: 37633 <at> debbugs.gnu.org, bernd@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Sun, 6 Oct 2019 14:31:12 +0200
> From: Anton Ertl <anton@HIDDEN>
> Cc: bernd@HIDDEN, 37633 <at> debbugs.gnu.org, anton@HIDDEN
> 
> On Sat, Oct 05, 2019 at 07:16:53PM +0300, Eli Zaretskii wrote:
> > 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.
> 
> It's the encoding that you assumed for the text when you loaded the
> file into the buffer.

I'm not sure this is correct.  You are saying that the compiler counts
bytes in the original file, not in its output (which might be encoded
differently).  Do we have conclusive evidence that this is always
true?

> the byte position does not depend on the encoding (unlike the
> character position).

??? The same Latin-1 characters encoded in ISO-8859-1 and in UTF-8
will yield a different number of bytes.  So I don't think I understand
how can you say the above.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37633; Package emacs. Full text available.

Message received at 37633 <at> debbugs.gnu.org:


Received: (at 37633) by debbugs.gnu.org; 6 Oct 2019 17:35:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 06 13:35:43 2019
Received: from localhost ([127.0.0.1]:46793 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iHARa-0008Cj-QT
	for submit <at> debbugs.gnu.org; Sun, 06 Oct 2019 13:35:43 -0400
Received: from mail.net2o.de ([185.183.156.191]:36826)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bernd@HIDDEN>) id 1iHARY-0008CY-8t
 for 37633 <at> debbugs.gnu.org; Sun, 06 Oct 2019 13:35:41 -0400
Received: from daiyu.localnet
 (200116b826959f009a939674d530470e.dip.versatel-1u1.de
 [IPv6:2001:16b8:2695:9f00:9a93:9674:d530:470e])
 (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 11872400A4;
 Sun,  6 Oct 2019 19:35:39 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=net2o.de; s=mail;
 t=1570383339; bh=2TVV43yqowkwGfnjbynNCbJQd/tKUaq+0zXThsFhgIg=;
 h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
 b=pi6KiX6XUVp8rhsvV1j0y7/nopFrmBOX/9Tfx4PKzQ0goDYn6PaIkQk8hMaMP6nli
 C5pep6Xbjxr670vbzjAVgo9CNHRT1ObWiMlz2uKDt+uHYc8M6iMmX2kXjZnIM3oKch
 F+C/3lFIhYiBMsv50O4I0I+UtuTyV3Nwr0d5hYUg=
From: Bernd Paysan <bernd@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#37633: Column part interpreted wrong in compilation mode
Date: Sun, 06 Oct 2019 19:35:33 +0200
Message-ID: <1695563.6luOslTFfj@daiyu>
In-Reply-To: <83h84l3ibo.fsf@HIDDEN>
References: <2282407.NbK4RY0fEn@daiyu> <1734660.yQRGRn46K7@daiyu>
 <83h84l3ibo.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart1893091.2ROf81rDly";
 micalg="pgp-sha256"; protocol="application/pgp-signature"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 37633
Cc: 37633 <at> debbugs.gnu.org, anton@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--nextPart1893091.2ROf81rDly
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"

Am Sonntag, 6. Oktober 2019, 19:16:43 CEST schrieb Eli Zaretskii:
> Sorry, now I'm confused.  Does the compiler count bytes in its output
> (where a Latin-1 line could be recoded in UTF-8, and thus have a
> different number of bytes), or does it count bytes in the original
> file (in this case encoded in Latin-1, i.e. 1 byte per character)?

It counts bytes in its input.  The output is just a copy of the input.  The 
compiler (GCC here) does not even care or know about what encoding the input 
actually is.  It's supposed to be ASCII compatible, the compiler does not try 
to be smart.  C symbols are supposed to be ASCII only, C strings are just byte 
arrays.  Don't try to overestimate the smartness here.

-- 
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/

--nextPart1893091.2ROf81rDly
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part.
Content-Transfer-Encoding: 7Bit

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEERJ1NDqPQRwYnwBjr9y2Uk5MtoGcFAl2aJeUACgkQ9y2Uk5Mt
oGe+kxAAhhdtEwSbJsosxfme4sQEYN8jl4JbJJ6/ua0l6jcc9CXsPUxpAGHwX6zY
h9ecgqP7GSQBfXH+jUxiF2jMPzHocWI5fpfXFLYmkEF4nrSiJgPFBJHlLH10UxeI
IMJYqypsziihKIBam00Tlu/i8CFOaeEXMZe9zZgKsmS9/xffpgtYTSaRFIiMHm91
HzhfRVx6Op68/QKrJ+1cOGGpPmRRz9OJvDsZytDUF8yWDgWhqRJVovhK9fBZtMnt
EKKwKVK899GYiosLJPPQwcH40btrVwi2tDREtya5pBIOvjSC6GplFlVwp3qcMHyB
3j9YEUMASJ3GJV443PnJQkigjpUC+QIgZXGPZ+Vy8SvxuqU0r/FX9OEMiCfuiKUs
JalOMUwOCK+AAijt9jB0ilkjcp8eA8YjqHX49gsLUlXbLJxP8A6QdyxewTZ5mpZA
7zG2nXALbJvLDfD+Ey7bbbx1Ppwr0d+kEl9ZZQSTzpxS2ziDGvuRfXOr62+EEV66
nVI3ykLfQemaVLxmozHPBbCUtuIo0W1fWxe22sJLwNB2s5CLsJE6DOiyi4b5QeMp
aqXRMpLspJb5BOWcqCHqq+WFaoc+uOdpletI/a5QjfZVRJBD33LsgT4IbTiGDlG4
RZRxKQNdBgYEeynHcn+cGo/rrjgfH2iHcF0sPO9WN1YXLVFZ0JE=
=41EQ
-----END PGP SIGNATURE-----

--nextPart1893091.2ROf81rDly--







Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37633; Package emacs. Full text available.

Message received at 37633 <at> debbugs.gnu.org:


Received: (at 37633) by debbugs.gnu.org; 6 Oct 2019 17:17:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 06 13:17:00 2019
Received: from localhost ([127.0.0.1]:46766 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iHA9U-0007dO-CE
	for submit <at> debbugs.gnu.org; Sun, 06 Oct 2019 13:17:00 -0400
Received: from eggs.gnu.org ([209.51.188.92]:56122)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1iHA9R-0007d7-R2
 for 37633 <at> debbugs.gnu.org; Sun, 06 Oct 2019 13:16:58 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:60184)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1iHA9K-0000YG-L3; Sun, 06 Oct 2019 13:16:50 -0400
Received: from [176.228.60.248] (port=4761 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1iHA9J-0003aR-Jt; Sun, 06 Oct 2019 13:16:50 -0400
Date: Sun, 06 Oct 2019 20:16:43 +0300
Message-Id: <83h84l3ibo.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Bernd Paysan <bernd@HIDDEN>
In-reply-to: <1734660.yQRGRn46K7@daiyu> (message from Bernd Paysan on Sat, 05
 Oct 2019 21:24:17 +0200)
Subject: Re: bug#37633: Column part interpreted wrong in compilation mode
References: <2282407.NbK4RY0fEn@daiyu> <4972654.EqVlIXum5b@daiyu>
 <83pnjb2ee9.fsf@HIDDEN> <1734660.yQRGRn46K7@daiyu>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 37633
Cc: 37633 <at> debbugs.gnu.org, anton@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Bernd Paysan <bernd@HIDDEN>
> Cc: 37633 <at> debbugs.gnu.org, anton@HIDDEN
> Date: Sat, 05 Oct 2019 21:24:17 +0200
> 
> > But the column numbers are counted in the compiler output, and no one
> > said that the compiler output must be encoded the same as the source
> > file.
> 
> The column numbers are written as decimal digits in the compiler output.  They 
> are not even calculated, they are just extracted.
> 
> Indeed, the compiler output can be in a different encoding, but it doesn't 
> matter.  The navigation that needs to change is in the source code file.  This 
> is compiler output from compiling an iso-latin encoded file, the compiler 
> output itself is utf-8:
> 
> test-iso.c:3:23: error: ‘c’ undeclared (first use in this function)
>     3 |  printf("test��� %i", c);
>       |                       ^
> 
> The 23(-1) are the numbers of bytes to get from the start of line to the 
> missing variable 'c'.  The three � are there, because the compilation buffer 
> contains invalid characters now.  They are iso-latin characters, invalid in 
> utf-8.  But this is irrelevant.  All the compilation mode does is extract the 
> test-iso.c (file name), 3 (line number) and 23 (byte index).  Navigation 
> happens in test-iso.c, it's a file (the C compiler can't access emacs 
> buffers), autodetection is pretty reliable.

Sorry, now I'm confused.  Does the compiler count bytes in its output
(where a Latin-1 line could be recoded in UTF-8, and thus have a
different number of bytes), or does it count bytes in the original
file (in this case encoded in Latin-1, i.e. 1 byte per character)?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37633; Package emacs. Full text available.

Message received at 37633 <at> debbugs.gnu.org:


Received: (at 37633) by debbugs.gnu.org; 6 Oct 2019 14:10:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 06 10:10:49 2019
Received: from localhost ([127.0.0.1]:46679 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iH7FH-0002fb-B9
	for submit <at> debbugs.gnu.org; Sun, 06 Oct 2019 10:10:49 -0400
Received: from a4.complang.tuwien.ac.at ([128.130.173.65]:58296)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <anton@HIDDEN>)
 id 1iH5gw-0001OT-RX
 for 37633 <at> debbugs.gnu.org; Sun, 06 Oct 2019 08:31:15 -0400
Received: from anton by a4 with local (Exim 4.89)
 (envelope-from <anton@HIDDEN>)
 id 1iH5gu-0007mC-JV; Sun, 06 Oct 2019 14:31:12 +0200
Date: Sun, 6 Oct 2019 14:31:12 +0200
From: Anton Ertl <anton@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#37633: Column part interpreted wrong in compilation mode
Message-ID: <20191006123112.ej2heyy2qudfcvep@HIDDEN>
References: <2282407.NbK4RY0fEn@daiyu> <83zhif2n0q.fsf@HIDDEN>
 <83y2xz2mmi.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <83y2xz2mmi.fsf@HIDDEN>
User-Agent: NeoMutt/20170113 (1.7.2)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 37633
X-Mailman-Approved-At: Sun, 06 Oct 2019 10:10:46 -0400
Cc: 37633 <at> debbugs.gnu.org, bernd@HIDDEN, anton@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: anton@HIDDEN
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Sat, Oct 05, 2019 at 07:16:53PM +0300, Eli Zaretskii wrote:
> 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.

It's the encoding that you assumed for the text when you loaded the
file into the buffer.

The assumption may be wrong, which may cause problems elsewhere, but
should not cause problems for interpreting the byte position, because
the byte position does not depend on the encoding (unlike the
character position).

- anton




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37633; Package emacs. Full text available.

Message received at 37633 <at> debbugs.gnu.org:


Received: (at 37633) by debbugs.gnu.org; 5 Oct 2019 19:24:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 05 15:24:25 2019
Received: from localhost ([127.0.0.1]:45277 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iGpfF-0006fg-3P
	for submit <at> debbugs.gnu.org; Sat, 05 Oct 2019 15:24:25 -0400
Received: from mail.net2o.de ([185.183.156.191]:48160)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bernd@HIDDEN>) id 1iGpfD-0006fW-4S
 for 37633 <at> debbugs.gnu.org; Sat, 05 Oct 2019 15:24:23 -0400
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 88AF0400A5;
 Sat,  5 Oct 2019 21:24:21 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=net2o.de; s=mail;
 t=1570303461; bh=vvjPKDPkhT1vTtf0gfvQnh7EhjcyoPoXrwTKSzmarVs=;
 h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
 b=E+fq/WAY2OYnAm+kx0gcQqCACKZsRdVNvo0OmbplgPqzYhWAA4lzg6l54auUatluA
 oZbi3vuYHqWTx5Fbbsa9O/0xmVVoI2spMe+yVtDakOS/7OYiXXBTtBZYAPf0E/XqVI
 3ryRqWfpjFDaRjOdgNfw0OCZv/5sWmVzxvVAa0I8=
From: Bernd Paysan <bernd@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#37633: Column part interpreted wrong in compilation mode
Date: Sat, 05 Oct 2019 21:24:17 +0200
Message-ID: <1734660.yQRGRn46K7@daiyu>
In-Reply-To: <83pnjb2ee9.fsf@HIDDEN>
References: <2282407.NbK4RY0fEn@daiyu> <4972654.EqVlIXum5b@daiyu>
 <83pnjb2ee9.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart8679054.kqHN69lPoH";
 micalg="pgp-sha256"; protocol="application/pgp-signature"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 37633
Cc: 37633 <at> debbugs.gnu.org, anton@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--nextPart8679054.kqHN69lPoH
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"

Am Samstag, 5. Oktober 2019, 21:14:38 CEST schrieb Eli Zaretskii:
> > From: Bernd Paysan <bernd@HIDDEN>
> > Cc: 37633 <at> debbugs.gnu.org, anton@HIDDEN
> > Date: Sat, 05 Oct 2019 20:54:38 +0200
> >=20
> > > We cannot use 'exact' here because there's no file per se: we only
> > > have the compiler output.  We must use 'approximate'.
> >=20
> > The buffer that matters is not the compiler output, it's the buffer of =
the
> > source code.
>=20
> But the column numbers are counted in the compiler output, and no one
> said that the compiler output must be encoded the same as the source
> file.

The column numbers are written as decimal digits in the compiler output.  T=
hey=20
are not even calculated, they are just extracted.

Indeed, the compiler output can be in a different encoding, but it doesn't=
=20
matter.  The navigation that needs to change is in the source code file.  T=
his=20
is compiler output from compiling an iso-latin encoded file, the compiler=20
output itself is utf-8:

test-iso.c:3:23: error: =E2=80=98c=E2=80=99 undeclared (first use in this f=
unction)
    3 |  printf("test=EF=BF=BD=EF=BF=BD=EF=BF=BD %i", c);
      |                       ^

The 23(-1) are the numbers of bytes to get from the start of line to the=20
missing variable 'c'.  The three =EF=BF=BD are there, because the compilati=
on buffer=20
contains invalid characters now.  They are iso-latin characters, invalid in=
=20
utf-8.  But this is irrelevant.  All the compilation mode does is extract t=
he=20
test-iso.c (file name), 3 (line number) and 23 (byte index).  Navigation=20
happens in test-iso.c, it's a file (the C compiler can't access emacs=20
buffers), autodetection is pretty reliable.

There might be some corner cases, where the suggested solution is not perfe=
ct,=20
but it's much better than what we have now.

=2D-=20
Bernd Paysan
"If you want it done right, you have to do it yourself"
net2o id: kQusJzA;7*?t=3Duy@X}1GWr!+0qqp_Cn176t4(dQ*
https://net2o.de/

--nextPart8679054.kqHN69lPoH
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part.
Content-Transfer-Encoding: 7Bit

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEERJ1NDqPQRwYnwBjr9y2Uk5MtoGcFAl2Y7eEACgkQ9y2Uk5Mt
oGcF8A//WwIiLs2O7toTiaFxoh4zeufk71werrJsB3uAeVifk2qij/zRa7ZF2azb
zlfYhcOfZKtf/fpwqxvmUhsvf7xZYTFJRy/a+k9CDv1A3o08nawnazLkJOghBtXz
cmXn046GxwJstZ+2geqGMGltxaqCUwCvM+0vLg9SAqzIiRFMb3tQWi+3qvSTm5Nn
ye2nku2gUPKxChJBfmDlz9eTUce1ILddnpIZG6pLPaH14PNTTClMOrTyFRvJB4T3
0ZSXRR9cJCpfDdGgMxang2OFyW6+z/R8hjMeUOmrQn2KC31zxVd8prOWYON1h1LA
SvH287s766uJZywEyGd8YY8vHGtSx8k3RebuX5Ye/nHCGJLF5acHNIuFDp/hwFMn
92G9MIbr+pa0QFl5E/07FwRe81aDK88+AmNy9vIOquCl3a3c8z0EMYdbDObTXubO
5ZbSMGB/+yw+dkVQtcCHMDU1jv3p5N9WVgAORRq8w3iqdmcb7f8Erb4n6te6cG3P
ett4j2/4VwL8rIb90cXRDMs0bb8dabvl3Nh6VMiSDjMGU0a8Ihwj78z8Ch5S6Pn1
1+jH1OegNBNeaNWANB7Ylci/xUpf8OmQs7o+cquRWZHI+tuUScnjQWSc7SAgXcK/
zc6enl3vGyfO77ybpwevPk0WWRRjfBcFCe7lQ9DZZKuhJHaOjyY=
=D7sz
-----END PGP SIGNATURE-----

--nextPart8679054.kqHN69lPoH--







Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37633; Package emacs. Full text available.

Message received at 37633 <at> debbugs.gnu.org:


Received: (at 37633) by debbugs.gnu.org; 5 Oct 2019 19:15:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 05 15:15:21 2019
Received: from localhost ([127.0.0.1]:45253 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iGpWT-0006Qo-A9
	for submit <at> debbugs.gnu.org; Sat, 05 Oct 2019 15:15:21 -0400
Received: from eggs.gnu.org ([209.51.188.92]:53772)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1iGpWR-0006QZ-D4
 for 37633 <at> debbugs.gnu.org; Sat, 05 Oct 2019 15:15:20 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:45146)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1iGpWJ-0000rr-Sv; Sat, 05 Oct 2019 15:15:12 -0400
Received: from [176.228.60.248] (port=3983 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1iGpWH-0000bG-9c; Sat, 05 Oct 2019 15:15:11 -0400
Date: Sat, 05 Oct 2019 22:14:38 +0300
Message-Id: <83pnjb2ee9.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Bernd Paysan <bernd@HIDDEN>
In-reply-to: <4972654.EqVlIXum5b@daiyu> (message from Bernd Paysan on Sat, 05
 Oct 2019 20:54:38 +0200)
Subject: Re: bug#37633: Column part interpreted wrong in compilation mode
References: <2282407.NbK4RY0fEn@daiyu> <3214582.DlieoQrNBz@daiyu>
 <83v9t32fe9.fsf@HIDDEN> <4972654.EqVlIXum5b@daiyu>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 37633
Cc: 37633 <at> debbugs.gnu.org, anton@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Bernd Paysan <bernd@HIDDEN>
> Cc: 37633 <at> debbugs.gnu.org, anton@HIDDEN
> Date: Sat, 05 Oct 2019 20:54:38 +0200
> 
> > We cannot use 'exact' here because there's no file per se: we only
> > have the compiler output.  We must use 'approximate'.
> 
> The buffer that matters is not the compiler output, it's the buffer of the 
> source code.

But the column numbers are counted in the compiler output, and no one
said that the compiler output must be encoded the same as the source
file.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37633; Package emacs. Full text available.

Message received at 37633 <at> debbugs.gnu.org:


Received: (at 37633) by debbugs.gnu.org; 5 Oct 2019 18:54:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 05 14:54:48 2019
Received: from localhost ([127.0.0.1]:45230 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iGpCZ-0005vE-U9
	for submit <at> debbugs.gnu.org; Sat, 05 Oct 2019 14:54:48 -0400
Received: from mail.net2o.de ([185.183.156.191]:43284)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bernd@HIDDEN>) id 1iGpCY-0005v6-FD
 for 37633 <at> debbugs.gnu.org; Sat, 05 Oct 2019 14:54:47 -0400
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 6B05E400A5;
 Sat,  5 Oct 2019 20:54:45 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=net2o.de; s=mail;
 t=1570301685; bh=dKoQTGtdR6lMAXqlVWMokDpY4htb+81BZoBzS1wBkNY=;
 h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
 b=A7m4LN+hP1i1kycdOiYwKR5y3Upu9xZEuQLgol/tGh4SKUeykmvX+/5cX9MBE14Ny
 EK6NqZEK2DfrQOFRsoMsteYNJmF0HPFaVzQoXBScbYSsxAbKqJa1zDoyQcs9OU9Uhb
 vLXTeaIaT3Qz13u9UMAHJIJCGcAKRpGA4oNa9j6Y=
From: Bernd Paysan <bernd@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#37633: Column part interpreted wrong in compilation mode
Date: Sat, 05 Oct 2019 20:54:38 +0200
Message-ID: <4972654.EqVlIXum5b@daiyu>
In-Reply-To: <83v9t32fe9.fsf@HIDDEN>
References: <2282407.NbK4RY0fEn@daiyu> <3214582.DlieoQrNBz@daiyu>
 <83v9t32fe9.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart1639075.fsWDCgpQyP";
 micalg="pgp-sha256"; protocol="application/pgp-signature"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 37633
Cc: 37633 <at> debbugs.gnu.org, anton@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--nextPart1639075.fsWDCgpQyP
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"

Am Samstag, 5. Oktober 2019, 20:53:02 CEST schrieb Eli Zaretskii:
> > 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.
> 
> We cannot use 'exact' here because there's no file per se: we only
> have the compiler output.  We must use 'approximate'.

The buffer that matters is not the compiler output, it's the buffer of the 
source code.

-- 
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/

--nextPart1639075.fsWDCgpQyP
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part.
Content-Transfer-Encoding: 7Bit

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEERJ1NDqPQRwYnwBjr9y2Uk5MtoGcFAl2Y5u4ACgkQ9y2Uk5Mt
oGfx8Q//YsKEXjKIJCOSCX/sGWOQLAX4+FicXtmxS43Oou6xKQRw3XSGu2DsudNu
4w5tZe02sMLDSmoNbr7OuyI4+vVF/haBE2CyyjfSE9HWcdB8PeeIDnEnHXhhGSDT
s8HJ0C5CiYW6TAqq4udRoeb8zlnKVTAdNhcol8yQ5MO0eucZ0FL75huQyfi5rUAZ
V7lqq+AZrw2wqSyzD97Z3L4DK/Eb7BniFY8Io8qwoqCy0oWHPNTOzCsv4TJWYgJl
hqbrKwtCvrzjgYGuwWQWolc6mQmbMeiH1G/rTABv7Kz1p+n3sF2APM1HyICkUzVC
xYqnrA7AAwlCNYSU7bSc9z1FRNjTaIg7zpfVL6Rxd0t99B3GF3uE+zdpsYhPRhsL
uHf83q+eYIGG5bKjdLDpYlNlw3hYRo8U4nFm/ISv7lfKum2Rr9ZgYh7TvDly3g7F
xY5p+FBIvZZE+S7X0jLaZXxX0aRnkPBT5YlkWo7Zp5YHfiPg4gDMr2H1DjxNreH3
saVdaPHEIvrxCwUfCfdaWdMqeD1BWQ2DuG8yoSpDD22oBbKeCw+AkQlYYymXJRkC
4SHLktQuDe6bjUs+naq3IX1DMAAmyaXGMZsifHtnXwGzR8kKWyVepCPRfS8Gcp1n
yDmrX3y+V30udNIymFCtoXPucgoF0mV+PwXY1VDQrgZ8xCzRM54=
=XA1U
-----END PGP SIGNATURE-----

--nextPart1639075.fsWDCgpQyP--







Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37633; Package emacs. Full text available.

Message received at 37633 <at> debbugs.gnu.org:


Received: (at 37633) by debbugs.gnu.org; 5 Oct 2019 18:53:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 05 14:53:21 2019
Received: from localhost ([127.0.0.1]:45226 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iGpBB-0005tC-Ed
	for submit <at> debbugs.gnu.org; Sat, 05 Oct 2019 14:53:21 -0400
Received: from eggs.gnu.org ([209.51.188.92]:51875)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1iGpB9-0005sy-66
 for 37633 <at> debbugs.gnu.org; Sat, 05 Oct 2019 14:53:19 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:44875)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1iGpB2-0007sX-Gs; Sat, 05 Oct 2019 14:53:12 -0400
Received: from [176.228.60.248] (port=2606 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1iGpB0-000582-VX; Sat, 05 Oct 2019 14:53:12 -0400
Date: Sat, 05 Oct 2019 21:53:02 +0300
Message-Id: <83v9t32fe9.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Bernd Paysan <bernd@HIDDEN>
In-reply-to: <3214582.DlieoQrNBz@daiyu> (message from Bernd Paysan on Sat, 05
 Oct 2019 19:05:26 +0200)
Subject: Re: bug#37633: Column part interpreted wrong in compilation mode
References: <2282407.NbK4RY0fEn@daiyu> <83zhif2n0q.fsf@HIDDEN>
 <83y2xz2mmi.fsf@HIDDEN> <3214582.DlieoQrNBz@daiyu>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 37633
Cc: 37633 <at> debbugs.gnu.org, anton@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Bernd Paysan <bernd@HIDDEN>
> Cc: 37633 <at> debbugs.gnu.org, anton@HIDDEN
> Date: Sat, 05 Oct 2019 19:05:26 +0200
> 
> 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).

Encoding of subprocess output is generally not auto-detected, it uses
the defaults derived from the locale.  I don't recommend
auto-detecting, because that's quite fragile (and is not needed here
anyway, IMO).

> 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.

We cannot use 'exact' here because there's no file per se: we only
have the compiler output.  We must use 'approximate'.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37633; Package emacs. Full text available.

Message received at 37633 <at> debbugs.gnu.org:


Received: (at 37633) by debbugs.gnu.org; 5 Oct 2019 17:35:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 05 13:35:09 2019
Received: from localhost ([127.0.0.1]:45144 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iGnxU-00040R-JQ
	for submit <at> debbugs.gnu.org; Sat, 05 Oct 2019 13:35:08 -0400
Received: from mail.net2o.de ([185.183.156.191]:59128)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bernd@HIDDEN>) id 1iGnxS-00040J-Ej
 for 37633 <at> debbugs.gnu.org; Sat, 05 Oct 2019 13:35:06 -0400
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 EA415400A5;
 Sat,  5 Oct 2019 19:35:04 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=net2o.de; s=mail;
 t=1570296905; bh=9mY2eugeTV8iqqnx8ye/M+5m4gJy8OQUIS6itsvMESQ=;
 h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
 b=cFzErEqlB/520BJ4w+BAY+LKiPmKLMeHVk7FHCsgEM+0qrP5GKIf9rMvCWqwLWspY
 gv9tXj/YrCZ9kAKluW5zkne/N/ayW6gl3qz4IfxlSPYKpth+dJfp7v7vxHeI3K/xaT
 NDwqd1cuFEoJUMsnpuV1IMw7sTUb/8zFUNyp2Eu0=
From: Bernd Paysan <bernd@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#37633: Column part interpreted wrong in compilation mode
Date: Sat, 05 Oct 2019 19:34:59 +0200
Message-ID: <5734355.dGnZCJOEy5@daiyu>
In-Reply-To: <83y2xz2mmi.fsf@HIDDEN>
References: <2282407.NbK4RY0fEn@daiyu> <83zhif2n0q.fsf@HIDDEN>
 <83y2xz2mmi.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart2638071.gE4rUgo7W6";
 micalg="pgp-sha256"; protocol="application/pgp-signature"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 37633
Cc: 37633 <at> debbugs.gnu.org, anton@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--nextPart2638071.gE4rUgo7W6
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"

Am Samstag, 5. Oktober 2019, 18:16:53 CEST schrieb Eli Zaretskii:
> > Date: Sat, 05 Oct 2019 19:08:21 +0300
> > From: Eli Zaretskii <eliz@HIDDEN>
> > Cc: 37633 <at> debbugs.gnu.org, anton@HIDDEN
> >=20
> > > Suggested solution: Use byte-to-position to calculate the position in
> > > compilation-move-to-column.
> >=20
> > This only works in UTF-8 locales, and is not 100% even there, so it
> > isn't the right solution.
>=20
> In general, byte-to-position is meant to be used only for converting
> between byte and character positions of text in Emacs buffers.
>=20
> 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.

Ok, first I tried bufferpos-to-filepos.

(defun compilation-move-to-column (col screen)
  "Go to column COL on the current line.
If SCREEN is non-nil, columns are screen columns, otherwise, they are
just char-counts."
  (setq col (- col compilation-first-column))
  (let ((realpos (filepos-to-bufferpos (+ (bufferpos-to-filepos (line-
beginning-position) 'approximate) col) 'approximate)))
    (goto-char (min realpos (line-end-position)))))

I left out the (if ) with (screen), because I just wanted to test this case=
=2E =20
=46or the examples I've used, it works with the 'approximate setting.

I leave out this screen part to the emacs maintainers, because you maybe wa=
nt=20
a three-case statement: nil for char-count, 't for screen columns, and=20
'bytepos for byte-accurate position.  JavaScript (node) is ok with the char-
count mode.

Second test-case: iso8859-1 encoded file with

void foo() {
	printf("test %i", b);
	printf("test=C3=A4=C3=B6=C3=BC %i", c);
}

=2E..
test-iso.c:3:23: error: =E2=80=98c=E2=80=99 undeclared (first use in this f=
unction)
    3 |  printf("test=EF=BF=BD=EF=BF=BD=EF=BF=BD %i", c);
      |                       ^
=2E..

works when you click there, too.

=2D-=20
Bernd Paysan
"If you want it done right, you have to do it yourself"
net2o id: kQusJzA;7*?t=3Duy@X}1GWr!+0qqp_Cn176t4(dQ*
https://net2o.de/

--nextPart2638071.gE4rUgo7W6
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part.
Content-Transfer-Encoding: 7Bit

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEERJ1NDqPQRwYnwBjr9y2Uk5MtoGcFAl2Y1EMACgkQ9y2Uk5Mt
oGdMxw/+OgPbYCHudx5A3hIn4qLSbX7TVXX2exi195XqAbqPzPt4nsHoev8TxxnE
z6HuV5WZba/2ataH/+B6cEzvVYj67OybPi2psQNHQapGFhJcqaETzbAITDF8PRTI
G+cgaOnudSoBHB/2BXMxMYgexW8VoQUBdhH5LjxoJF78EwkCd3YgNjQei+RP8VvK
+3X95WFWkTsRpwUgZHjb5Qkt1KuzrW4P9YRZLtNLtn1loATghOkrtGC+O3C97Uil
cgBZIEobliYZs0Cmhm4Cz4R+wGxxQnowISms1p6eEgi2WD32ku2TqnotIQmchUpo
o5NCE7519g3kvQsfsf3bniURzGOGFOKpCo92yYp+9OGHrxNMSjZ1xMAGPM6enyIU
C1bQAitCLTPuRBGStlhp7zoN7+GXCkbSKuqGDAQeykfYN97Br7e/+atXCGhzpy8K
iy8Q6lF3ItnL1jpZJnpJe2fcvv1/ayD5DyanbUFuzllENwzVg9m5d/5mtTzXxskW
C7ECGBmR3HP/dtZEOr3eFJIVi5+oINdCXt5U5FWan1W/ejTud2eUYrDueFRAZD0T
8VFTFQhYIZE6DC1dIzT1/6g7slpd9QtK0xOP7iDvz0wR70uf7kND/0HxSrhVbVfM
k153SyWSCvz4NXEGumX4Lun4x7KGux3nMjCuq95Q8+iHU6ydPjs=
=hGRI
-----END PGP SIGNATURE-----

--nextPart2638071.gE4rUgo7W6--







Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37633; Package emacs. Full text available.

Message received at 37633 <at> debbugs.gnu.org:


Received: (at 37633) by debbugs.gnu.org; 5 Oct 2019 17:31:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 05 13:31:03 2019
Received: from localhost ([127.0.0.1]:45135 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iGntW-0003uD-HW
	for submit <at> debbugs.gnu.org; Sat, 05 Oct 2019 13:31:03 -0400
Received: from mail.net2o.de ([185.183.156.191]:54582)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bernd@HIDDEN>) id 1iGnUr-0003Gj-IM
 for 37633 <at> debbugs.gnu.org; Sat, 05 Oct 2019 13:05:33 -0400
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=
From: Bernd Paysan <bernd@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#37633: Column part interpreted wrong in compilation mode
Date: Sat, 05 Oct 2019 19:05:26 +0200
Message-ID: <3214582.DlieoQrNBz@daiyu>
In-Reply-To: <83y2xz2mmi.fsf@HIDDEN>
References: <2282407.NbK4RY0fEn@daiyu> <83zhif2n0q.fsf@HIDDEN>
 <83y2xz2mmi.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart3431936.ahdLZCUoPY";
 micalg="pgp-sha256"; protocol="application/pgp-signature"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 37633
X-Mailman-Approved-At: Sat, 05 Oct 2019 13:31:01 -0400
Cc: 37633 <at> debbugs.gnu.org, anton@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--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 <eliz@HIDDEN>
> > Cc: 37633 <at> debbugs.gnu.org, anton@HIDDEN
> > 
> > > 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--







Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37633; Package emacs. Full text available.

Message received at 37633 <at> debbugs.gnu.org:


Received: (at 37633) by debbugs.gnu.org; 5 Oct 2019 17:31:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 05 13:31:02 2019
Received: from localhost ([127.0.0.1]:45133 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iGntV-0003u2-R5
	for submit <at> debbugs.gnu.org; Sat, 05 Oct 2019 13:31:02 -0400
Received: from mail.net2o.de ([185.183.156.191]:53168)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bernd@HIDDEN>) id 1iGnNt-00034y-UK
 for 37633 <at> debbugs.gnu.org; Sat, 05 Oct 2019 12:58:23 -0400
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 4549D400A5;
 Sat,  5 Oct 2019 18:58:20 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=net2o.de; s=mail;
 t=1570294700; bh=ydZNB4W3qh50ljju9pig7DtdbCUnpiWTuIzxMfEEtB4=;
 h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
 b=TWCkbWSN/3tYx4ZkGQMH62OPGEkAHXRm2etgavs6NnaWUtgUOBC9hamMiF8394yJb
 Ck3490A+soBPso718lb5uLpQhcjRXAKpXkjcQ9bwSHKOdNbVF454ZqqhBFg9rWVPyR
 4netaiRcCEk9MhJZj90luiIwEYc+8YenBtAnk9bI=
From: Bernd Paysan <bernd@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#37633: Column part interpreted wrong in compilation mode
Date: Sat, 05 Oct 2019 18:58:15 +0200
Message-ID: <13424667.pQ1DPruH6J@daiyu>
In-Reply-To: <83zhif2n0q.fsf@HIDDEN>
References: <2282407.NbK4RY0fEn@daiyu> <83zhif2n0q.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart2598873.lcUfPC60YD";
 micalg="pgp-sha256"; protocol="application/pgp-signature"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 37633
X-Mailman-Approved-At: Sat, 05 Oct 2019 13:31:00 -0400
Cc: 37633 <at> debbugs.gnu.org, anton@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--nextPart2598873.lcUfPC60YD
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"

Am Samstag, 5. Oktober 2019, 18:08:21 CEST schrieb Eli Zaretskii:
> > Cc: anton@HIDDEN
> > Date: Sat, 05 Oct 2019 13:12:34 +0200
> > From: Bernd Paysan via "Bug reports for GNU Emacs,
> > 
> >  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> > 
> > 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.

It's at least an improvement, though it's not perfect.

-- 
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/

--nextPart2598873.lcUfPC60YD
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part.
Content-Transfer-Encoding: 7Bit

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEERJ1NDqPQRwYnwBjr9y2Uk5MtoGcFAl2Yy6cACgkQ9y2Uk5Mt
oGcaRw//bCpKphHn0brJfN7gz/+dv0Wdg+Fxi+Q38P5mRTAz0Z9b3WEvBtw50nfL
SHlSlpCfTtE5VhhKV63ToNcadqRVMsVYevuROdOBOW7/5k41UaikfSUcKeB8VeHC
pEVjamPrSa2VzFLPNYaAcPLvqWR/7FdR5uMqEddY+NBD4Y1WmeWFJbrr6IXNIu4U
ODgfERPD7cm7HLHzP3R1UTsIO1QjTNzz0+hmI5U9dZ48EdgQHCJTtnHL4N7HCk5i
MPfCbFCtIRP0Zzpxqqqv1buF1bspfGnaL8LVb7hLOnUmw42HG7Uy1mMchRDzdz/R
Kcff8EDnONk6BefH+eZo3HIGgbk8lCnDX9DSOZwMztrPOPVVCKdSgi+qfQYv8izz
LUO/WuYQfrP00kom6pZ/M4uTUDkSxCS1ALB82sAzJcz3YmDys3/MjvK+0oUecO9z
rQ9cVK0/mclRWq0UVFsNFMAsskBwXz4JqaSiAwvY2D1bW/j40usPtgO4JeX+bfy2
V+03QfhV42Wv1Xwg7VPhq+SA3fragfdvduIxCKmVLTq5aKty8VZd/GWCUaxCmP/7
gKCTZRAgevNOHgc3+qzthTOJVebzKS9gesobS0MTROmZzihGMSUYNGqOEwajC2lQ
4SiBuiTlUtfcjOmB+t1RP4YdlgZ40g+cgkxoIme9UEss+hhALHo=
=bkBS
-----END PGP SIGNATURE-----

--nextPart2598873.lcUfPC60YD--







Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37633; Package emacs. Full text available.

Message received at 37633 <at> debbugs.gnu.org:


Received: (at 37633) by debbugs.gnu.org; 5 Oct 2019 16:17:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 05 12:17:17 2019
Received: from localhost ([127.0.0.1]:45076 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iGmk9-00023s-7m
	for submit <at> debbugs.gnu.org; Sat, 05 Oct 2019 12:17:17 -0400
Received: from eggs.gnu.org ([209.51.188.92]:40876)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1iGmk7-00023a-1q
 for 37633 <at> debbugs.gnu.org; Sat, 05 Oct 2019 12:17:15 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:42922)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1iGmk1-0000m3-VH; Sat, 05 Oct 2019 12:17:09 -0400
Received: from [176.228.60.248] (port=1050 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1iGmjz-0008An-15; Sat, 05 Oct 2019 12:17:09 -0400
Date: Sat, 05 Oct 2019 19:16:53 +0300
Message-Id: <83y2xz2mmi.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: bernd@HIDDEN
In-reply-to: <83zhif2n0q.fsf@HIDDEN> (message from Eli Zaretskii on Sat, 05
 Oct 2019 19:08:21 +0300)
Subject: Re: bug#37633: Column part interpreted wrong in compilation mode
References: <2282407.NbK4RY0fEn@daiyu> <83zhif2n0q.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 37633
Cc: 37633 <at> debbugs.gnu.org, anton@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Sat, 05 Oct 2019 19:08:21 +0300
> From: Eli Zaretskii <eliz@HIDDEN>
> Cc: 37633 <at> debbugs.gnu.org, anton@HIDDEN
> 
> > 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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37633; Package emacs. Full text available.

Message received at 37633 <at> debbugs.gnu.org:


Received: (at 37633) by debbugs.gnu.org; 5 Oct 2019 16:08:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 05 12:08:43 2019
Received: from localhost ([127.0.0.1]:45064 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iGmbq-0001p6-WF
	for submit <at> debbugs.gnu.org; Sat, 05 Oct 2019 12:08:43 -0400
Received: from eggs.gnu.org ([209.51.188.92]:39855)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1iGmbo-0001oq-Nm
 for 37633 <at> debbugs.gnu.org; Sat, 05 Oct 2019 12:08:41 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:42667)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1iGmbi-0005iw-2Q; Sat, 05 Oct 2019 12:08:34 -0400
Received: from [176.228.60.248] (port=4508 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1iGmbg-0007FN-9C; Sat, 05 Oct 2019 12:08:33 -0400
Date: Sat, 05 Oct 2019 19:08:21 +0300
Message-Id: <83zhif2n0q.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Bernd Paysan <bernd@HIDDEN>
In-reply-to: <2282407.NbK4RY0fEn@daiyu> (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#37633: Column part interpreted wrong in compilation mode
References: <2282407.NbK4RY0fEn@daiyu>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 37633
Cc: 37633 <at> debbugs.gnu.org, anton@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: anton@HIDDEN
> Date: Sat, 05 Oct 2019 13:12:34 +0200
> From: Bernd Paysan via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> 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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37633; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 5 Oct 2019 15:44:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 05 11:44:41 2019
Received: from localhost ([127.0.0.1]:45038 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iGmEZ-0001Cy-7u
	for submit <at> debbugs.gnu.org; Sat, 05 Oct 2019 11:44:41 -0400
Received: from lists.gnu.org ([209.51.188.17]:53318)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bernd@HIDDEN>) id 1iGhzT-00037b-NH
 for submit <at> debbugs.gnu.org; Sat, 05 Oct 2019 07:12:48 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:45233)
 by lists.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <bernd@HIDDEN>) id 1iGhzS-0004LD-5J
 for bug-gnu-emacs@HIDDEN; Sat, 05 Oct 2019 07:12:47 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled
 version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <bernd@HIDDEN>) id 1iGhzQ-0001yL-Nm
 for bug-gnu-emacs@HIDDEN; Sat, 05 Oct 2019 07:12:45 -0400
Received: from mail.net2o.de ([185.183.156.191]:38202)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <bernd@HIDDEN>) id 1iGhzQ-0001x5-7r
 for bug-gnu-emacs@HIDDEN; Sat, 05 Oct 2019 07:12:44 -0400
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 C7B14400A5;
 Sat,  5 Oct 2019 13:12:40 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=net2o.de; s=mail;
 t=1570273961; bh=rO1don6BNwwT6CzvwIsUooUbc29wvS8YWj+GflmtUP4=;
 h=From:To:Cc:Subject:Date:From;
 b=ALK8/KzGGmmVny0vGE8wnDiAhOvq1LGb/+Rhj6ukUGiRGNvrpHsWPwREW+LWHV1X0
 S66/zvAtk1cxPkD59wMLV5IJC8AEGcLYX7LdX9Xs9yz5p6B6zkpaGhf0B7or4KFRLw
 wY9DNQeyaIU0SDXA+bWmNj2fnnvus1eWRtQ8AjA8=
From: Bernd Paysan <bernd@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: Column part interpreted wrong in compilation mode
Date: Sat, 05 Oct 2019 13:12:34 +0200
Message-ID: <2282407.NbK4RY0fEn@daiyu>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart1635646.hbdS1Sl0bu";
 micalg="pgp-sha256"; protocol="application/pgp-signature"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-Received-From: 185.183.156.191
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Sat, 05 Oct 2019 11:44:37 -0400
Cc: anton@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

--nextPart1635646.hbdS1Sl0bu
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"

Compilers like gcc and others (e.g. gforth) output file:line:column on each=
=20
error or warning.  However, =E2=80=9Ccolumn=E2=80=9D here is really the byt=
e offset into the=20
line (starting at 1).

Problems arise when tabs and UTF-8 glyphs are involved, e.g. compile

=2D--------------test.c---------------
void foo() {
	printf("test %i", b);
	printf("test=E4=BD=A0=E5=A5=BD %i", c);
}
=2D--------------gcc test.c---------------
=2D*- mode: compilation; default-directory: "~/tmp/" -*-
Compilation started at Sat Oct  5 12:13:23

gcc test.c
test.c: In function =E2=80=98foo=E2=80=99:
test.c:2:2: warning: implicit declaration of function =E2=80=98printf=E2=80=
=99 [-Wimplicit-
function-declaration]
    2 |  printf("test %i", b);
      |  ^~~~~~
test.c:2:2: warning: incompatible implicit declaration of built-in function=
=20
=E2=80=98printf=E2=80=99
test.c:1:1: note: include =E2=80=98<stdio.h>=E2=80=99 or provide a declarat=
ion of =E2=80=98printf=E2=80=99
  +++ |+#include <stdio.h>
    1 | void foo() {
test.c:2:20: error: =E2=80=98b=E2=80=99 undeclared (first use in this funct=
ion)
    2 |  printf("test %i", b);
      |                    ^
test.c:2:20: note: each undeclared identifier is reported only once for eac=
h=20
function it appears in
test.c:3:26: error: =E2=80=98c=E2=80=99 undeclared (first use in this funct=
ion)
    3 |  printf("test=E4=BD=A0=E5=A5=BD %i", c);
      |                          ^

Compilation exited abnormally with code 1 at Sat Oct  5 12:13:23
=2D--------------snip---------------

When you click on test.c:2:20, it gets you to the second t in 'test'; if yo=
u=20
click on test.c:3:26, you end up on the '%'.  The expected result would be =
to=20
have the cursor on 'b' and 'c'.

The problem has been discussed here two years ago:

https://www.reddit.com/r/emacs/comments/5m3i59/
ask_remacs_get_compile_mode_to_treat_column/

Suggested solution: Use byte-to-position to calculate the position in=20
compilation-move-to-column.

Since debugging environments can also control Emacs e.g. through emacsclien=
t=20
+line:column file, I suggest adding a pattern that indicates that column he=
re=20
really means byte position, too, e.g. +line/byte or +line,byte or such. Or=
=20
just interpret it as byte position, too.  gedit e.g. counts a tab as 1 if y=
ou=20
open a file with +line:column options, but counts one UTF-8 glyph also as 1=
=20
(which is not how compilers count).

Some programming languages convert unicode glyphs and other characters into=
=20
internal character types (e.g. JavaScript), and then the gedit behavior or =
the=20
behavior with compilation-error-screen-columns set to nil is probably ok. =
=20
It's just that we need a byte mode here, too. True and false is not enough.

=2D-=20
Bernd Paysan
"If you want it done right, you have to do it yourself"
net2o id: kQusJzA;7*?t=3Duy@X}1GWr!+0qqp_Cn176t4(dQ*
https://net2o.de/

--nextPart1635646.hbdS1Sl0bu
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part.
Content-Transfer-Encoding: 7Bit

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEERJ1NDqPQRwYnwBjr9y2Uk5MtoGcFAl2YeqIACgkQ9y2Uk5Mt
oGdhbg//f1kZQFeoMmjuQ1I4HytcKDRyv7pfAvwLHdZsIEUYR0ArXuW13cseTqnJ
+QSmxLFgU3Y6tht0nXvZ6ozAnR8YYkEIOBMiZYvVl1xgvwqveYlIdML9y6i9TB2U
iNoxMLuOJ7Xakoh5RKsfkvdNS/w5sHwpok45vZ43XdTaCgf/QDmN1otDXdTwhqvK
sJvAckU5VgHvoYU5i9Y20AmHImxvw4EtSGQSPW/um5rnSRUhn2GG/EWYREpi5Wpt
FbGBX+gSN0FMXqzV8ua8o8LQ0fmQDfHw1BGo+N9tc4kua4ZhI/CiB2q2yChmCixa
5Pk2XvgQELgC63XoZ9cGCD8rdIWnztjkUbT0Gso1alQkOTZm801eiPnu53zMVmBk
SUQ1sYz0W8gxF1iXiMGz9AFc2AwFULyy1wXlpkwVL+EYY3ecq2RFB5+kldQ7oSiS
gGayrWRY/CYKWmelGwqSRzFvYTfy8lOy29YmUsH9A5CDUqwKPyDdWZGEHLc+ekP9
RR2MhM6+gS5Li/iKTwMgjorVpBx+A2E3i1+tBCSZJj8T6cJq4Jw45UHtCiqEq72N
M/v5nbARjnAr/HQK7QzQIvkaPiYuEg0bSOuRxK+OaGslPgFHIb6hiRo0Z5J2Cy/n
Dr2kXk7/ENfkX0KwcsJ5cwVdLI2nuGYQztbXU1z7AguUePBfDj0=
=6/pF
-----END PGP SIGNATURE-----

--nextPart1635646.hbdS1Sl0bu--







Acknowledgement sent to Bernd Paysan <bernd@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#37633; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.