[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex b3153ec 16/26: Add function for reverting docume
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex b3153ec 16/26: Add function for reverting document buffer |
Date: |
Fri, 13 Nov 2015 17:00:37 +0000 |
branch: externals/auctex
commit b3153ec5dcdd4ea3b79fe710f32ea6bd49ce8bc1
Author: Tassilo Horn <address@hidden>
Commit: Tassilo Horn <address@hidden>
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.
---
doc/auctex.texi | 4 +++-
tex-buf.el | 19 ++++++++++++++++++-
2 files changed, 21 insertions(+), 2 deletions(-)
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.
- [elpa] externals/auctex b10ca71 01/26: Fix docstring., (continued)
- [elpa] externals/auctex b10ca71 01/26: Fix docstring., Tassilo Horn, 2015/11/13
- [elpa] externals/auctex 90ea1a0 02/26: Remove SmallCaps font declaration command., Tassilo Horn, 2015/11/13
- [elpa] externals/auctex dbeb71f 04/26: Improve style., Tassilo Horn, 2015/11/13
- [elpa] externals/auctex b4f95f9 07/26: Disable special filling of math constructs, Tassilo Horn, 2015/11/13
- [elpa] externals/auctex 6351078 09/26: Use LaTeX-style-list for default classes completion., Tassilo Horn, 2015/11/13
- [elpa] externals/auctex 9dba8fd 15/26: Make View command work no matter how emacs started, Tassilo Horn, 2015/11/13
- [elpa] externals/auctex c39c63f 13/26: Add new style hologo.el., Tassilo Horn, 2015/11/13
- [elpa] externals/auctex d56502e 05/26: Support node name completion in texinfo, Tassilo Horn, 2015/11/13
- [elpa] externals/auctex a2f8bc6 08/26: Fix Texinfo-make-node-list, Tassilo Horn, 2015/11/13
- [elpa] externals/auctex 52275f9 03/26: Improve style., Tassilo Horn, 2015/11/13
- [elpa] externals/auctex b3153ec 16/26: Add function for reverting document buffer,
Tassilo Horn <=
- [elpa] externals/auctex 4527e8a 10/26: Update documentation., Tassilo Horn, 2015/11/13
- [elpa] externals/auctex f52479b 11/26: Improve checking of a TeX distribution and make it optional, Tassilo Horn, 2015/11/13
- [elpa] externals/auctex fb09c26 06/26: Warn about duplicate texinfo nodes, Tassilo Horn, 2015/11/13
- [elpa] externals/auctex a4c6a19 21/26: Update release-related Makefile rules, Tassilo Horn, 2015/11/13
- [elpa] externals/auctex cb4e33e 12/26: Set output extension for Texinfo files, Tassilo Horn, 2015/11/13
- [elpa] externals/auctex d465076 22/26: Update for upcoming release, Tassilo Horn, 2015/11/13
- [elpa] externals/auctex 5179308 18/26: Change default value of LaTeX-fill-break-at-separators, Tassilo Horn, 2015/11/13
- [elpa] externals/auctex cc72777 19/26: More ERT tests, Tassilo Horn, 2015/11/13
- [elpa] externals/auctex df7dbbd 23/26: Release_11.89, Tassilo Horn, 2015/11/13
- [elpa] externals/auctex 3aa4bdb 17/26: Add ChangeLog entry, Tassilo Horn, 2015/11/13