I also use pdf-tools as pdf viewer with auctex, and the auto refresh of
the viewer buffer works (with auctex 11.89) but only with LaTeX, not
with ConTeXt.
I checked that TeX-after-TeX-LaTeX-command-finished-hook is not used
with ConTeXt-mode.
I have changed the function TeX-ConTeXt-sentinel in context.el adding at
the end
(unless TeX-error-list
(run-hook-with-args 'TeX-after-TeX-LaTeX-command-finished-hook
(with-current-buffer TeX-command-buffer
(expand-file-name
(TeX-active-master (TeX-output-extension))))))
and now the auto refresh works also in ConTeXt.
There is a better way to enable the auto refresh for ConTeXt?
It is possible to include in AUCTeX the auto refresh feature also for
ConTeXt?
Andrea De Michele.
Tassilo Horn <[email protected]> writes:
> AW <[email protected]> writes:
>
>> (require 'subr-x)
>> (defun th/pdf-view-revert-buffer-maybe (file)
>> (when-let ((buf (find-buffer-visiting file)))
>> (with-current-buffer buf
>> (when (derived-mode-p 'pdf-view-mode)
>> (pdf-view-revert-buffer nil t)))))
>>
>> (add-hook 'TeX-after-TeX-LaTeX-command-finished-hook
>> #'th/pdf-view-revert-buffer-maybe)
>
> Note that this private function of mine is now included in AUCTeX in a
> slightly different version that works for doc-view and pdf-tools. The
> manual describes the setup.
>
> ,----[ (info "(auctex)Modes and Hooks") ]
> | -- Variable: TeX-after-TeX-LaTeX-command-finished-hook
> | Hook which is run after the TeX/LaTeX processor has successfully
> | finished compiling your document. (*Note Processing::, for finding
> | out how to compile your document). Each function in the hook is
> | run with 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. The function 'TeX-revert-document-buffer' can be
> | added to the hook for this purpose.
> `----
>
> ,----[ C-h f TeX-revert-document-buffer RET ]
> | TeX-revert-document-buffer is a compiled Lisp function in ‘tex-buf.el’.
> |
> | (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’.)
> `----
>
> Bye,
> Tassilo
>
>
> _______________________________________________
> auctex mailing list
> [email protected]
> https://lists.gnu.org/mailman/listinfo/auctex
--
Andrea De Michele
_______________________________________________
auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/auctex