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. f52479b816c0e60972932


From: Mosè Giordano
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. f52479b816c0e6097293221b8488144cbdea9123
Date: Fri, 06 Nov 2015 22:36:18 +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  f52479b816c0e6097293221b8488144cbdea9123 (commit)
      from  4527e8a440bd21985f3b1284904eb93527527b15 (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 f52479b816c0e6097293221b8488144cbdea9123
Author: Mosè Giordano <address@hidden>
Date:   Fri Nov 6 23:34:35 2015 +0100

    Improve checking of a TeX distribution and make it optional
    
    * tex-buf.el (TeX-check-TeX, TeX-check-TeX-command-not-found): New
    customizable options.
    (TeX-command): Do a better check for the presence of a TeX
    distribution.  Run `call-process' instead of `executable-find',
    like `TeX-run-command' actually does.  The point is that
    `call-process' and `start-process' use `PATH' environment
    variable, `executable-find' uses `exec-path' variable and they do
    not need to match, but we should check what `TeX-run-command' will
    really do.
    
    * doc/auctex.texi (Processor Options): Document `TeX-check-TeX'.
    
    * doc/changes.texi: Mention `TeX-check-TeX'.

diff --git a/ChangeLog b/ChangeLog
index 6d8a74b..387c136 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2015-11-06  Mosè Giordano  <address@hidden>
+
+       * tex-buf.el (TeX-check-TeX, TeX-check-TeX-command-not-found): New
+       customizable options.
+       (TeX-command): Do a better check for the presence of a TeX
+       distribution.  Run `call-process' instead of `executable-find',
+       like `TeX-run-command' actually does.  The point is that
+       `call-process' and `start-process' use `PATH' environment
+       variable, `executable-find' uses `exec-path' variable and they do
+       not need to match, but we should check what `TeX-run-command' will
+       really do.
+
+       * doc/auctex.texi (Processor Options): Document `TeX-check-TeX'.
+
+       * doc/changes.texi: Mention `TeX-check-TeX'.
+
 2015-11-03  Mosè Giordano  <address@hidden>
 
        * doc/auctex.texi (Processor Options): Document
diff --git a/doc/auctex.texi b/doc/auctex.texi
index 6489c44..4b0f001 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -2989,6 +2989,23 @@ command can either be a variable or a string.  An empty 
string or nil
 means there is no command available.
 @end defopt
 
+In some systems, Emacs cannot inherit the PATH environment variable from
+the shell and thus @AUCTeX{} may not be able to run @TeX{} commands.
+Before running them, @AUCTeX{} checks if it able to find those commands
+and will warn you in case it fails.  You can skip this test by changing
+the option @code{TeX-check-TeX}.
+
address@hidden TeX-check-TeX
address@hidden TeX-command
address@hidden TeX-check-TeX-command-not-found
+If non-nil, @AUCTeX{} will check if it is able to find a working @TeX{}
+distribution before running @TeX{}, @LaTeX{}, @ConTeXt{}, etc.  It
+actually checks if can run @code{TeX-command} command or the shell
+returns a command not found error.  The error code returned by the shell
+in this case can be set in @code{TeX-check-TeX-command-not-found}
+option.
address@hidden defopt
+
 Some @LaTeX{} packages requires the document to be compiled with a
 specific engine.  Notable examples are fontspec and polyglossia
 packages, which require address@hidden and address@hidden engines.  If you try 
to
diff --git a/doc/changes.texi b/doc/changes.texi
index ed3ad01..fb927f6 100644
--- a/doc/changes.texi
+++ b/doc/changes.texi
@@ -56,9 +56,13 @@ built-in expanders.  You might want to keep in 
@code{TeX-expand-list}
 only new expansion strings.
 
 @item
-When new option @code{TeX-check-engine} is non-nil, before running
address@hidden commands @AUCTeX{} will check whether the correct engine has
-been set, based upon known restrictions posed by @LaTeX{} packages.
+Before running commands like @TeX{} and @LaTeX{}, now @AUCTeX{} performs
+some checks.  If @code{TeX-check-TeX} is non-nil, it will test whether a
+working @TeX{} distribution is actually present in the system and
+available to Emacs.  Instead, when @code{TeX-check-engine} is non-nil,
+before running @LaTeX{} commands @AUCTeX{} will check whether the
+correct engine has been set, based upon known restrictions posed by
address@hidden packages.
 
 @item
 Basic support to @ConTeXt{} Mark IV has been added.  Users can now
diff --git a/tex-buf.el b/tex-buf.el
index ec3653c..61a61ad 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -437,6 +437,16 @@ Do you want to select one of these engines?"
         (add-file-local-variable 'TeX-engine engine)
         (save-buffer))))))
 
+(defcustom TeX-check-TeX t
+  "Whether AUCTeX should check if a working TeX distribution is present."
+  :group 'TeX-command
+  :type 'boolean)
+
+(defcustom TeX-check-TeX-command-not-found 127
+  "Numerical code returned by shell for a command not found error."
+  :group 'TeX-command
+  :type 'integer)
+
 (defun TeX-command (name file &optional override-confirm)
   "Run command NAME on the file returned by calling FILE.
 
@@ -481,8 +491,11 @@ been set."
 
     ;; 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))
+    (and TeX-check-TeX
+         (member name '("TeX" "LaTeX" "AmSTeX" "ConTeXt" "ConTeXt Full"))
+        (= TeX-check-TeX-command-not-found
+            (call-process TeX-shell nil nil nil
+                          TeX-shell-command-option 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)

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

Summary of changes:
 ChangeLog        |   16 ++++++++++++++++
 doc/auctex.texi  |   17 +++++++++++++++++
 doc/changes.texi |   10 +++++++---
 tex-buf.el       |   17 +++++++++++++++--
 4 files changed, 55 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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