Subject: Re: bug#21729: doc-view messed up by early auto-revert

From: Tassilo Horn <[email-masked]>
Date: Thu, 22 Oct 2015 17:11:29 +0200

Stefan Monnier <[email-masked]> writes:

>> 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.

In commit 11d1422, I've added a check which omits reverting when the PDF
is corrupted and spits out a message if doc-view-revert-buffer has been
called interactively.  Seems to work fine but it is annoying that
autorevert.el spits out a "Reverting buffer ..." message whenever it
calls revert-buffer.

I think in doc-view-mode it's obvious enough when a file is being
reverted, so maybe we should set auto-revert-verbose to nil
buffer-locally?

Bye,
Tassilo