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

commit 0c257b99d169f47bee08de86df426461d37fb582
Author: Tassilo Horn <t...@gnu.org>
Date:   Sat Jun 29 10:01:18 2013 +0200

    Prefer TeX distro GS wrappers.
    
    * preview.el (preview-gs-command): Prefer the TeX distro
    ghostscript wrapper scripts `rungs' and `mgs' over calling `gs'
    directly which requires it to be in PATH.
---
 preview/ChangeLog  |    6 ++++++
 preview/preview.el |   12 +++++++++---
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/preview/ChangeLog b/preview/ChangeLog
index 6565b91..8d057fe 100644
--- a/preview/ChangeLog
+++ b/preview/ChangeLog
@@ -1,3 +1,9 @@
+2013-06-29  Tassilo Horn  <t...@gnu.org>
+
+       * preview.el (preview-gs-command): Prefer the TeX distro
+       ghostscript wrapper scripts `rungs' and `mgs' over calling `gs'
+       directly which requires it to be in PATH.
+
 2013-06-26  Tassilo Horn  <t...@gnu.org>
 
        * Makefile.in (use-hint): Don't warn about problems with overly
diff --git a/preview/preview.el b/preview/preview.el
index 82ce926..77ebaab 100644
--- a/preview/preview.el
+++ b/preview/preview.el
@@ -344,9 +344,15 @@ LIST consists of TeX dimensions in sp (1/65536 TeX point)."
      (dotimes (i 4 box)
        (aset box i (+ (aref box i) (aref border i)))))))
 
-(defcustom preview-gs-command (if (eq system-type 'windows-nt)
-                                 "GSWIN32C.EXE"
-                               "gs")
+(defcustom preview-gs-command
+  (or ;; The GS wrapper coming with TeX Live
+      (executable-find "rungs")
+      ;; The GS wrapper coming with MikTeX
+      (executable-find "mgs")
+      ;; Windows ghostscript
+      (executable-find "GSWIN32C.EXE")
+      ;; standard GhostScript
+      (executable-find "gs"))
   "*How to call gs for conversion from EPS.  See also `preview-gs-options'."
   :group 'preview-gs
   :type 'string)

Reply via email to