auctex-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX-diffs] GNU AUCTeX branch, master, updated. b3153ec5dcdd4ea3b79fe


From: Tassilo Horn
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. b3153ec5dcdd4ea3b79fe710f32ea6bd49ce8bc1
Date: Tue, 10 Nov 2015 20:00:17 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU AUCTeX".

The branch, master has been updated
       via  b3153ec5dcdd4ea3b79fe710f32ea6bd49ce8bc1 (commit)
      from  9dba8fdf2af6fb36fcce009a372bcd50adc57f2e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit b3153ec5dcdd4ea3b79fe710f32ea6bd49ce8bc1
Author: Tassilo Horn <address@hidden>
Date:   Tue Nov 10 20:58:42 2015 +0100

    Add function for reverting document buffer
    
    * tex-buf.el (TeX-revert-document-buffer): New function.
    (TeX-after-TeX-LaTeX-command-finished-hook): Mention it in docstring.
    * doc/auctex.texi (Modes and Hooks): Mention it in manual.

diff --git a/doc/auctex.texi b/doc/auctex.texi
index 4b0f001..8c02499 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -3599,9 +3599,11 @@ the compiled output document as its argument.
 
 This is useful for automatically refreshing the viewer after
 re-compilation especially when using Emacs viewers such as DocView or
-PDF Tools.
+PDF Tools.  The function @code{TeX-revert-document-buffer} can be added
+to the hook for this purpose.
 @end defvr
 @vindex TeX-after-TeX-LaTeX-command-finished-hook
address@hidden TeX-revert-document-buffer
 
 @node Multifile
 @section Multifile Documents
diff --git a/tex-buf.el b/tex-buf.el
index 61a61ad..bc19f7d 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -889,7 +889,24 @@ the current style options."
   "Hook being run after TeX/LaTeX finished successfully.
 The functions in this hook are run with the DVI/PDF output file
 given as argument.  Using this hook can be useful for updating
-the viewer automatically after re-compilation of the document.")
+the viewer automatically after re-compilation of the document.
+
+If you use an emacs-internal viewer such as `doc-view-mode' or
+`pdf-view-mode', add `TeX-revert-document-buffer' to this hook.")
+
+(defun TeX-revert-document-buffer (file)
+  "Revert the buffer visiting FILE.
+This function is intended to be used in
+`TeX-after-TeX-LaTeX-command-finished-hook' for users that view
+their compiled document with an emacs viewer such as
+`doc-view-mode' or `pdf-view-mode'.  (Note that this function
+just calls `revert-buffer' in the respective buffer and thus
+requires that the corresponding mode defines a sensible
+`revert-buffer-function'.)"
+  (let ((buf (find-buffer-visiting file)))
+    (when buf
+      (with-current-buffer buf
+       (revert-buffer nil t t)))))
 
 (defvar TeX-after-start-process-function nil
   "Hooks to run after starting an asynchronous process.

-----------------------------------------------------------------------

Summary of changes:
 doc/auctex.texi |    4 +++-
 tex-buf.el      |   19 ++++++++++++++++++-
 2 files changed, 21 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

[Prev in Thread] Current Thread [Next in Thread]