unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: handa@gnu.org, gregory@heytings.org, 46933@debbugs.gnu.org
Subject: bug#46933: Possible bugs in filepos-to-bufferpos / bufferpos-to-filepos
Date: Wed, 22 Jun 2022 16:11:06 +0300	[thread overview]
Message-ID: <83h74ckfmd.fsf@gnu.org> (raw)
In-Reply-To: <87r13huybe.fsf@gnus.org> (message from Lars Ingebrigtsen on Wed,  22 Jun 2022 06:17:09 +0200)

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: handa@gnu.org,  gregory@heytings.org,  46933@debbugs.gnu.org
> Date: Wed, 22 Jun 2022 06:17:09 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> But there's one new in-tree usage for this -- in
> >> hexl.el.  (In hexl-mode-exit and hexl-maybe-dehexlify-buffer.)  I don't
> >> know whether that has the problem described in this bug report, though
> >> (I'm not familiar with hexl.el at all).
> >
> > There's no reason why this won't be relevant to hexl: it is a
> > general-purpose hex editor, so editing a file encoded in one of those
> > problematic ISO-2022 encodings should bump into the same issues.
> 
> I meant more that I don't really know what it wants to achieve, or what
> kinds of files are typically used by hexl users.

Let me explain.  These functions are used in hexl for the case where
you have a file visited "normally" (which decodes it using some
coding-system, as Emacs normally would), then want to run hexl on it
for some reason, and later perhaps go back to editing it "normally".
In this case, hexl tries to keep the buffer position in the same place
across conversion to hexl and back, because that's what the user would
expect.  The coding-system used for that is the one Emacs used to
decode the file's contents when originally visiting the file
"normally".

> Do people use that on huge hex dumps or something else?

Hexl is also useful to look at the exact contents of a file that
displays strangely when visited normally, and that's when these
functions are useful.

Of course, accuracy is less important in this case than in the case of
multi-file Info, so maybe we don't care too much for the hexl case.





  reply	other threads:[~2022-06-22 13:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-04 21:21 bug#46933: Possible bugs in filepos-to-bufferpos / bufferpos-to-filepos Gregory Heytings
2021-03-21 15:27 ` Eli Zaretskii
2021-03-27  5:38   ` handa
2021-03-27  7:54     ` Eli Zaretskii
2021-03-27 13:23       ` handa
2021-03-27 13:54         ` Eli Zaretskii
2021-03-28 14:29           ` handa
2021-03-28 14:51             ` Eli Zaretskii
2021-04-01 15:14               ` handa
2021-04-01 15:25                 ` Eli Zaretskii
2021-04-01 15:32                 ` Eli Zaretskii
2021-04-03 16:12                   ` handa
2022-06-20  0:59                     ` Lars Ingebrigtsen
2022-06-20 11:52                       ` Eli Zaretskii
2022-06-21 10:40                         ` Lars Ingebrigtsen
2022-06-21 12:14                           ` Eli Zaretskii
2022-06-22  4:17                             ` Lars Ingebrigtsen
2022-06-22 13:11                               ` Eli Zaretskii [this message]
2021-03-27 14:24     ` Gregory Heytings

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=83h74ckfmd.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=46933@debbugs.gnu.org \
    --cc=gregory@heytings.org \
    --cc=handa@gnu.org \
    --cc=larsi@gnus.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).