From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#46933: Possible bugs in filepos-to-bufferpos / bufferpos-to-filepos Date: Wed, 22 Jun 2022 16:11:06 +0300 Message-ID: <83h74ckfmd.fsf@gnu.org> References: <9cff0f8894f167925251@heytings.org> <87im53ny95.fsf@gnu.org> <87r13kqhdj.fsf@gnus.org> <838rprmu1f.fsf@gnu.org> <877d5a1er4.fsf@gnus.org> <835ykukybi.fsf@gnu.org> <87r13huybe.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32808"; mail-complaints-to="usenet@ciao.gmane.io" Cc: handa@gnu.org, gregory@heytings.org, 46933@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 22 15:12:54 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o40A9-0008Hd-7v for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 Jun 2022 15:12:53 +0200 Original-Received: from localhost ([::1]:43366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o40A8-0001bO-3T for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 Jun 2022 09:12:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o409Z-0001Sb-7s for bug-gnu-emacs@gnu.org; Wed, 22 Jun 2022 09:12:22 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40474) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o409K-00011u-7F for bug-gnu-emacs@gnu.org; Wed, 22 Jun 2022 09:12:13 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o409K-0000Kp-2T for bug-gnu-emacs@gnu.org; Wed, 22 Jun 2022 09:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 Jun 2022 13:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46933 X-GNU-PR-Package: emacs Original-Received: via spool by 46933-submit@debbugs.gnu.org id=B46933.16559034861240 (code B ref 46933); Wed, 22 Jun 2022 13:12:02 +0000 Original-Received: (at 46933) by debbugs.gnu.org; 22 Jun 2022 13:11:26 +0000 Original-Received: from localhost ([127.0.0.1]:34370 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o408k-0000Jw-FS for submit@debbugs.gnu.org; Wed, 22 Jun 2022 09:11:26 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:56036) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o408h-0000Jg-Ud for 46933@debbugs.gnu.org; Wed, 22 Jun 2022 09:11:24 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:41348) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o408b-0000wh-04; Wed, 22 Jun 2022 09:11:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=5Zuubx70G6TsGnoI7QrrA2bZHFs5fYe4PmUOBRiU6CI=; b=h+RXAqDASjC0 dUSC4K38Jgh0zXm4ASq/1D2aT0lJnF6V0CAZj9F4oN0ibZ0NlNg2JMDX6RGsAOeVjptnvyb2tHpvO IKktNPRZNzVOlaXvR1W9Yn00r4bzexgNOxpfp/JDPuA9zhZ3V2r7d7kjmdHudACJMMB46YTnteTk3 mzu0e8x+qgkAetXICC+eDJPMt1cF5bKgqxTTgZj4/ZWYnoG4G0DYYgTRCTX3mUwJ+03Vxu6iO6RCm DdB4X2GDsVfB2+0Y3Gv+uC0B4omVxoCbENCWqZ5xcjqupgJiEhkRjXyTcrzEGKqdFvJ9BQKVIHrRm hjjT6GVIU2Osn9cJBkPV+w==; Original-Received: from [87.69.77.57] (port=4886 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o408a-0004Bx-4T; Wed, 22 Jun 2022 09:11:16 -0400 In-Reply-To: <87r13huybe.fsf@gnus.org> (message from Lars Ingebrigtsen on Wed, 22 Jun 2022 06:17:09 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:235015 Archived-At: > From: Lars Ingebrigtsen > Cc: handa@gnu.org, gregory@heytings.org, 46933@debbugs.gnu.org > Date: Wed, 22 Jun 2022 06:17:09 +0200 > > Eli Zaretskii 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.