branch: elpa
commit 68d9b03eda8b461ef9dc83c27e0cc7ef79ce50b5
Author: Tassilo Horn <[email protected]>
Commit: Tassilo Horn <[email protected]>
Rename TeX-after-TeX-LaTeX-command-finished-hook
* tex-buf.el (TeX-after-compilation-finished-hook): Rename from
TeX-after-TeX-LaTeX-command-finished-hook.
* context.el (TeX-ConTeXt-sentinel): Run
TeX-after-compilation-finished-hook when the compilation was successful.
* doc/auctex.texi (Modes and Hooks): Adapt docs.
---
context.el | 7 ++++++-
doc/auctex.texi | 4 ++--
tex-buf.el | 12 ++++++++----
3 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/context.el b/context.el
index 62d7b3a..8d892f8 100644
--- a/context.el
+++ b/context.el
@@ -600,7 +600,12 @@ inserted after the sectioning command."
(t
(message (concat name ": problems after "
(TeX-current-pages)))
- (setq TeX-command-next TeX-command-default))))))
+ (setq TeX-command-next TeX-command-default)))))
+ (unless TeX-error-list
+ (run-hook-with-args 'TeX-after-compilation-finished-hook
+ (with-current-buffer TeX-command-buffer
+ (expand-file-name
+ (TeX-active-master (TeX-output-extension)))))))
;;; Environments
diff --git a/doc/auctex.texi b/doc/auctex.texi
index 8c02499..39125c9 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -3591,7 +3591,7 @@ and if it is relevant for all text modes, append it to
Other useful hooks are listed below.
-@defvr Variable TeX-after-TeX-LaTeX-command-finished-hook
+@defvr Variable TeX-after-compilation-finished-hook
Hook which is run after the @TeX{}/@LaTeX{} processor has successfully
finished compiling your document. (@xref{Processing}, for finding out
how to compile your document). Each function in the hook is run with
@@ -3602,7 +3602,7 @@ re-compilation especially when using Emacs viewers such
as DocView or
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
+@vindex TeX-after-compilation-finished-hook
@findex TeX-revert-document-buffer
@node Multifile
diff --git a/tex-buf.el b/tex-buf.el
index 1dd7587..2f6da70 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -889,8 +889,8 @@ the current style options."
;;; Command Hooks
-(defvar TeX-after-TeX-LaTeX-command-finished-hook nil
- "Hook being run after TeX/LaTeX finished successfully.
+(defvar TeX-after-compilation-finished-hook nil
+ "Hook being run after TeX/LaTeX/ConTeXt 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.
@@ -898,10 +898,14 @@ 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.")
+(make-obsolete-variable 'TeX-after-TeX-LaTeX-command-finished-hook
+ 'TeX-after-compilation-finished-hook
+ "11.89")
+
(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
+`TeX-after-compilation-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
@@ -1530,7 +1534,7 @@ Rerun to get mark in right position\\." nil t)
(push (cons idx-file t) LaTeX-idx-changed-alist)))
(unless TeX-error-list
- (run-hook-with-args 'TeX-after-TeX-LaTeX-command-finished-hook
+ (run-hook-with-args 'TeX-after-compilation-finished-hook
(with-current-buffer TeX-command-buffer
(expand-file-name
(TeX-active-master (TeX-output-extension)))))))