branch: externals/auctex commit b072f9ca25ff9cc2d6d3a40ab7699eb7ed42f9f6 Author: Mosè Giordano <m...@gnu.org> Commit: Mosè Giordano <m...@gnu.org>
Make sure there is a working TeX distribution before running *tex. * tex-buf.el (TeX-command): Check that AUCTeX can find a working TeX distribution before running some *TeX commands. --- ChangeLog | 5 +++++ tex-buf.el | 12 ++++++++++++ 2 files changed, 17 insertions(+), 0 deletions(-) diff --git a/ChangeLog b/ChangeLog index 20bd1dc..3b4b629 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-10-19 Mos� Giordano <m...@gnu.org> + + * tex-buf.el (TeX-command): Check that AUCTeX can find a working + TeX distribution before running some *TeX commands. + 2015-10-18 Mos� Giordano <m...@gnu.org> * tex.el (fboundp): Define a `TeX-completing-read-multiple' diff --git a/tex-buf.el b/tex-buf.el index 324be7a..ec3653c 100644 --- a/tex-buf.el +++ b/tex-buf.el @@ -479,6 +479,18 @@ been set." (if (get-buffer TeX-error-overview-buffer-name) (kill-buffer TeX-error-overview-buffer-name))) + ;; Before running some commands, check that AUCTeX is able to find "tex" + ;; program. + (and (member name '("TeX" "LaTeX" "AmSTeX" "ConTeXt" "ConTeXt Full")) + (not (executable-find TeX-command)) + (error (format "ERROR: AUCTeX cannot find a working TeX distribution. +Make sure you have one and that TeX binaries are in PATH environment variable%s" + (if (eq system-type 'darwin) + ". +If you are using OS X El Capitan or later +remember to add /Library/TeX/texbin/ to your PATH" + "")))) + ;; Now start the process (setq file (funcall file)) (TeX-process-set-variable file 'TeX-command-next TeX-command-Show)