Subject: Re: bug#23083: Reverting pdf in Multifile tex document

From: Tassilo Horn <[email-masked]>
Date: Sun, 27 Mar 2016 22:02:40 +0200

Waleed Yousef <[email-masked]> writes:

Hi Waleed,

> the good news is that the problem disappeared. However, a new problem
> occurred.
>
> For some preamble (which is really weird) the pdf does not revert
> (refresh); however it goes to the right page (but without
> refreshing).  For the following preamble, when I comment some packages
> the problem disappear!!

Good catch!  We've called `TeX-after-compilation-finished-functions'
only if `TeX-error-list' was empty with the intention that you don't
want to revert when errors have occurred which usually means that the
PDF will be broken anyhow.  However, your preamble issues lots of
warnings, and those are collected in `TeX-error-list', too.

I've fixed it in Git so that the hook is skipped only if there were real
errors and not just warnings.  Here is the patch:

--8<---------------cut here---------------start------------->8---
modified   tex-buf.el
@@ -1551,7 +1551,7 @@ Rerun to get mark in right position\\." nil t)
 		 (md5 (current-buffer)))))
 	 (push (cons idx-file t) LaTeX-idx-changed-alist)))
 
-  (unless TeX-error-list
+  (unless (memq 'error (mapcar #'car TeX-error-list))
     (run-hook-with-args 'TeX-after-compilation-finished-functions
 			(with-current-buffer TeX-command-buffer
 			  (expand-file-name
--8<---------------cut here---------------end--------------->8---

I'll do a new ELPA release within a week or so when I find some time.

Bye,
Tassilo