GNU bug report logs -
#37633
Column part interpreted wrong in compilation mode
Previous Next
Reported by: Bernd Paysan <bernd <at> net2o.de>
Date: Sat, 5 Oct 2019 15:45:01 UTC
Severity: normal
Tags: wontfix
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #32 received at 37633 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Am Samstag, 5. Oktober 2019, 21:14:38 CEST schrieb Eli Zaretskii:
> > From: Bernd Paysan <bernd <at> net2o.de>
> > Cc: 37633 <at> debbugs.gnu.org, anton <at> mips.complang.tuwien.ac.at
> > 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.
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.
There might be some corner cases, where the suggested solution is not perfect,
but it's much better than what we have now.
--
Bernd Paysan
"If you want it done right, you have to do it yourself"
net2o id: kQusJzA;7*?t=uy <at> X}1GWr!+0qqp_Cn176t4(dQ*
https://net2o.de/
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 3 years and 86 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.