unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Bernd Paysan via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 37633@debbugs.gnu.org, anton@mips.complang.tuwien.ac.at
Subject: bug#37633: Column part interpreted wrong in compilation mode
Date: Sat, 05 Oct 2019 19:05:26 +0200	[thread overview]
Message-ID: <3214582.DlieoQrNBz@daiyu> (raw)
In-Reply-To: <83y2xz2mmi.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1532 bytes --]

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@gnu.org>
> > Cc: 37633@debbugs.gnu.org, anton@mips.complang.tuwien.ac.at
> > 
> > > Suggested solution: Use byte-to-position to calculate the position in
> > > compilation-move-to-column.
> > 
> > This only works in UTF-8 locales, and is not 100% even there, so it
> > isn't the right solution.
> 
> In general, byte-to-position is meant to be used only for converting
> between byte and character positions of text in Emacs buffers.
> 
> For byte offsets in external text we have bufferpos-to-filepos, but
> that requires us to know the encoding of the external text.  We need
> to find a reasonable way of getting that.  Suggestions and patches
> welcome.

We can likely assume that the auto-detected encoding is the correct one, i.e. 
buffer-file-coding-system can be used (the default for the optional encoding 
system parameter for bufferpos-to-filepos and filepos-to-bufferpos).

I.e. go to the line selected, do a bufferpos-to-filepos on that position, add 
the column-1 to that, and do a filepos-to-bufferpos.  Jump there.

Problem with precision: "exact" requires encoding the entire file, so it's 
slow for large files.  Particularly with automatically generated files, this 
is likely not acceptable, so "approximate" could be good enough.

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

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2019-10-05 17:05 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-05 11:12 bug#37633: Column part interpreted wrong in compilation mode Bernd Paysan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2019-10-05 16:08 ` Eli Zaretskii
2019-10-05 16:16   ` Eli Zaretskii
2019-10-05 17:05     ` Bernd Paysan via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2019-10-05 18:53       ` Eli Zaretskii
2019-10-05 18:54         ` Bernd Paysan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2019-10-05 19:14           ` Eli Zaretskii
2019-10-05 19:24             ` Bernd Paysan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2019-10-06 17:16               ` Eli Zaretskii
2019-10-06 17:35                 ` Bernd Paysan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2019-10-06 18:54                   ` Eli Zaretskii
2019-10-06 19:16                     ` Bernd Paysan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2019-10-05 17:34     ` Bernd Paysan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2019-10-06 12:31     ` Anton Ertl
2019-10-06 17:53       ` Eli Zaretskii
2019-10-06 19:02         ` Bernd Paysan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2019-10-06 19:16           ` Eli Zaretskii
2019-10-06 19:22             ` Bernd Paysan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2019-10-06 19:34               ` Eli Zaretskii
2019-10-06 19:35                 ` Bernd Paysan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2019-10-07  7:09         ` Anton Ertl
2019-10-05 16:58   ` Bernd Paysan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-04-23 13:36 ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3214582.DlieoQrNBz@daiyu \
    --to=bug-gnu-emacs@gnu.org \
    --cc=37633@debbugs.gnu.org \
    --cc=anton@mips.complang.tuwien.ac.at \
    --cc=bernd@net2o.de \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).