monnier pushed a commit to branch externals/auctex
in repository elpa.

commit d8f06a75a9cd8030b826eb5d4981dc7dd63143be
Author: Tassilo Horn <t...@gnu.org>
Date:   Tue Jun 24 21:28:38 2014 +0200

    Better check for mgs.
    
    * preview.el (preview-gs-command): Don't run the mgs command if
    mgs is not installed.
---
 preview/ChangeLog  |    5 +++++
 preview/preview.el |    2 +-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/preview/ChangeLog b/preview/ChangeLog
index e443453..5ad7682 100644
--- a/preview/ChangeLog
+++ b/preview/ChangeLog
@@ -1,3 +1,8 @@
+2014-06-24  Tassilo Horn  <t...@gnu.org>
+
+       * preview.el (preview-gs-command): Don't run the mgs command if
+       mgs is not installed.
+
 2013-09-05  Tassilo Horn  <t...@gnu.org>
 
        * preview.el (preview-lispdir): New defvar.
diff --git a/preview/preview.el b/preview/preview.el
index 7b5aef6..72f624d 100644
--- a/preview/preview.el
+++ b/preview/preview.el
@@ -351,7 +351,7 @@ LIST consists of TeX dimensions in sp (1/65536 TeX point)."
       (let ((gs (executable-find "mgs")))
        ;; Check if mgs is functional for external non-MikTeX apps.
        ;; See 
http://blog.miktex.org/post/2005/04/07/Starting-mgsexe-at-the-DOS-Prompt.aspx
-       (when (= 0 (shell-command (concat gs " -q -dNODISPLAY -c quit")))
+       (when (and gs (= 0 (shell-command (concat gs " -q -dNODISPLAY -c 
quit"))))
          gs))
       ;; Windows ghostscript
       (executable-find "GSWIN32C.EXE")

Reply via email to