From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#34720: 26.1; Reverting a GPG buffer moves all markers to the end of the file Date: Tue, 27 Aug 2019 12:17:11 +0300 Message-ID: <83h863dl2g.fsf@gnu.org> References: <87a7ic9due.fsf@gnu.org> <87muhnrwvs.fsf@mouse.gnus.org> <875zmk5r5u.fsf@gnus.org> <83sgpofjc9.fsf@gnu.org> <87k1b04a3x.fsf@gnus.org> <83pnksfel0.fsf@gnu.org> <87v9uj2i7l.fsf@gnus.org> <83mufvdomu.fsf@gnu.org> <87ftln2f0f.fsf@gnus.org> <83imqjdmqb.fsf@gnu.org> <877e6z2d2a.fsf@gnus.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="135376"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 34720@debbugs.gnu.org, dunni@gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Aug 27 11:18:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i2XcB-000Z65-Jb for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Aug 2019 11:18:11 +0200 Original-Received: from localhost ([::1]:48648 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i2XcA-0002F1-BM for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Aug 2019 05:18:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44532) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i2Xc3-0002Ev-3f for bug-gnu-emacs@gnu.org; Tue, 27 Aug 2019 05:18:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i2Xc2-0008I5-0N for bug-gnu-emacs@gnu.org; Tue, 27 Aug 2019 05:18:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38876) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i2Xc1-0008Hx-Ta for bug-gnu-emacs@gnu.org; Tue, 27 Aug 2019 05:18:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i2Xc1-0000ju-N1 for bug-gnu-emacs@gnu.org; Tue, 27 Aug 2019 05:18:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Aug 2019 09:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34720 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 34720-submit@debbugs.gnu.org id=B34720.15668974392794 (code B ref 34720); Tue, 27 Aug 2019 09:18:01 +0000 Original-Received: (at 34720) by debbugs.gnu.org; 27 Aug 2019 09:17:19 +0000 Original-Received: from localhost ([127.0.0.1]:47697 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i2XbK-0000j0-Pl for submit@debbugs.gnu.org; Tue, 27 Aug 2019 05:17:19 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:36006) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i2XbG-0000im-Ug for 34720@debbugs.gnu.org; Tue, 27 Aug 2019 05:17:15 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:55198) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1i2XbB-0007nJ-Rm; Tue, 27 Aug 2019 05:17:09 -0400 Original-Received: from [176.228.60.248] (port=2371 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1i2XbA-0004VR-R5; Tue, 27 Aug 2019 05:17:09 -0400 In-reply-to: <877e6z2d2a.fsf@gnus.org> (message from Lars Ingebrigtsen on Tue, 27 Aug 2019 11:05:33 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:165951 Archived-At: > From: Lars Ingebrigtsen > Cc: dunni@gnu.org, 34720@debbugs.gnu.org > Date: Tue, 27 Aug 2019 11:05:33 +0200 > > (progn > (find-file "/tmp/foo.txt") > (kill-buffer (current-buffer)) > (when (file-exists-p "/tmp/foo.txt") > (delete-file "/tmp/foo.txt")) > (find-file "/tmp/foo.txt") > (insert "Test line.") > (setq test-marker1 (make-marker)) > (move-marker test-marker1 4) > (setq test-marker2 (make-marker)) > (move-marker test-marker2 5) > (save-buffer t) > (shell-command "echo new >> /tmp/foo.txt") > (revert-buffer nil t) > (list test-marker1 test-marker2)) > > => (# #) > > So the markers seem to be restored on `revert-buffer'? The original text is unchanged, you just added something at the end of the file. So markers at positions 4 and 5 will be preserved, yes. > The reason this doesn't happen in the epa case seems to be a bug in > Finsert_file_contents: When there's an external handler, it skips > directly to handled: and neglects to do the same_at_start computation, > which leaves that at point-min and restore_window_points ignores all > markers that have values that are larger than same_at_start. AFAIU, the problem with the epa case is that the buffer is erased and the text re-inserted. Isn't that the case? In any case, how can insert-file-contents know what the handler did wrt which part(s) of the buffer remained unchanged? > If the new text doesn't match the old text, the markers are not > restored: Of course.