From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#21729: doc-view messed up by early auto-revert Date: Thu, 22 Oct 2015 09:10:14 -0400 Message-ID: References: <874mhjtoc2.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1445519490 13374 80.91.229.3 (22 Oct 2015 13:11:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 22 Oct 2015 13:11:30 +0000 (UTC) Cc: 21729@debbugs.gnu.org To: Tassilo Horn Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 22 15:11:18 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZpFeG-0001Bq-FO for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Oct 2015 15:11:16 +0200 Original-Received: from localhost ([::1]:59771 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpFeF-0002bh-Rw for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Oct 2015 09:11:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpFe8-0002ab-9c for bug-gnu-emacs@gnu.org; Thu, 22 Oct 2015 09:11:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZpFe3-0004be-9z for bug-gnu-emacs@gnu.org; Thu, 22 Oct 2015 09:11:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41391) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpFe3-0004bY-6m for bug-gnu-emacs@gnu.org; Thu, 22 Oct 2015 09:11:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZpFe2-0004gs-2g for bug-gnu-emacs@gnu.org; Thu, 22 Oct 2015 09:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Oct 2015 13:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21729 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21729-submit@debbugs.gnu.org id=B21729.144551942817988 (code B ref 21729); Thu, 22 Oct 2015 13:11:01 +0000 Original-Received: (at 21729) by debbugs.gnu.org; 22 Oct 2015 13:10:28 +0000 Original-Received: from localhost ([127.0.0.1]:60332 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZpFdP-0004fx-O0 for submit@debbugs.gnu.org; Thu, 22 Oct 2015 09:10:28 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:58024) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZpFdJ-0004fi-3R for 21729@debbugs.gnu.org; Thu, 22 Oct 2015 09:10:21 -0400 Original-Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id t9MDAEuO002442; Thu, 22 Oct 2015 09:10:15 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 679E5AE24F; Thu, 22 Oct 2015 09:10:14 -0400 (EDT) In-Reply-To: <874mhjtoc2.fsf@gnu.org> (Tassilo Horn's message of "Thu, 22 Oct 2015 08:22:05 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5467=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5467> : inlines <3953> : streams <1525546> : uri <2068120> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:107839 Archived-At: > 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