From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Tassilo Horn <tsdh@gnu.org>
Cc: 21729@debbugs.gnu.org
Subject: bug#21729: doc-view messed up by early auto-revert
Date: Thu, 22 Oct 2015 09:10:14 -0400 [thread overview]
Message-ID: <jwvy4evvyxy.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <874mhjtoc2.fsf@gnu.org> (Tassilo Horn's message of "Thu, 22 Oct 2015 08:22:05 +0200")
> i.e., I revert the buffer from an AUCTeX hook that's run after the
> compilation has finished.
That's a good approach if you run pdflatex from Emacs itself, yes.
[ Hmm... I guess I could also use emacsclient to get the same result,
but it'd be a personal hack rather than a general functionality like
auto-revert-mode. ]
>> - Doc-view should inhibit auto-revert when the file was modified too
>> recently (on the assumption that it's not complete yet).
> Something like checking if the file's MTIME is more than a second ago?
Yes.
> Hm, no, that won't work. I currently work on some large document (~450
> pages). When I compile that, the file changes several times per second
> during the compilation, then it doesn't change for ~15 seconds while
> latex (lualatex in this case) is still running, and then starts changing
> again for maybe 3 seconds.
So we could additionally either check that the file is valid, or simply
"fail gracefully" if it isn't (e.g. keep displaying the old image, and
emit a message pointing to C-c C-c to see the raw data). But it's not
a deal breaker: in your case, we may end up trying to revert the file
too early, which is annoying, but as long as we do end up re-reverting
it when the file is finally complete, I think it's OK.
>> - [ Just guessing here: ] We may sometimes fail to revert the file
>> after it's complete, maybe because the last reversion finished after
>> the file was complete, even though it started before, so the last
>> reversion failed to include some changes that were added while the
>> buffer was being reverted.
> Yeah, that's possible. And I think there could also be a problem when
> people use latexmk which compiles your document several times until all
> refs are defined and its stable. Here, we might revert exactly between
> two latex runs.
I don't think reverting between two latex runs is a problem. It might
be "wasted work", but for a generic functionality like auto-revert-mode,
there's no way to do better since it can't know that another run is
about to come.
Stefan
next prev parent reply other threads:[~2015-10-22 13:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-21 18:05 bug#21729: doc-view messed up by early auto-revert Stefan Monnier
2015-10-22 6:22 ` Tassilo Horn
2015-10-22 13:10 ` Stefan Monnier [this message]
2015-10-22 15:11 ` Tassilo Horn
2015-10-23 9:33 ` Nicolas Richard
2015-10-23 10:08 ` Tassilo Horn
2019-09-29 13:03 ` Lars Ingebrigtsen
2019-10-03 9:21 ` Tassilo Horn
2022-02-03 21:01 ` Lars Ingebrigtsen
2019-10-03 13:31 ` Stefan Monnier
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=jwvy4evvyxy.fsf-monnier+emacsbugs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=21729@debbugs.gnu.org \
--cc=tsdh@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 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.