From: Eli Zaretskii <eliz@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 34720@debbugs.gnu.org, dunni@gnu.org
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 [thread overview]
Message-ID: <83h863dl2g.fsf@gnu.org> (raw)
In-Reply-To: <877e6z2d2a.fsf@gnus.org> (message from Lars Ingebrigtsen on Tue, 27 Aug 2019 11:05:33 +0200)
> From: Lars Ingebrigtsen <larsi@gnus.org>
> 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))
>
> => (#<marker at 4 in foo.txt> #<marker at 5 in foo.txt>)
>
> 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.
next prev parent reply other threads:[~2019-08-27 9:17 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-03 15:28 bug#34720: 26.1; Reverting a GPG buffer moves all markers to the end of the file Ian Dunn
2019-07-09 16:33 ` Lars Ingebrigtsen
2019-08-26 7:20 ` Lars Ingebrigtsen
2019-08-26 7:59 ` Eli Zaretskii
2019-08-26 8:14 ` Lars Ingebrigtsen
2019-08-26 9:42 ` Eli Zaretskii
2019-08-27 7:14 ` Lars Ingebrigtsen
2019-08-27 8:00 ` Eli Zaretskii
2019-08-27 8:23 ` Lars Ingebrigtsen
2019-08-27 8:41 ` Eli Zaretskii
2019-08-27 9:05 ` Lars Ingebrigtsen
2019-08-27 9:17 ` Eli Zaretskii [this message]
2019-08-27 9:15 ` Lars Ingebrigtsen
2019-08-27 10:20 ` Eli Zaretskii
2019-08-30 9:48 ` Lars Ingebrigtsen
2019-08-30 10:21 ` Lars Ingebrigtsen
2019-08-30 12:19 ` Eli Zaretskii
2019-08-27 8:37 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83h863dl2g.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=34720@debbugs.gnu.org \
--cc=dunni@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.