emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 145/299: Select mgs only if it's functional for non-MikTeX apps.


From: Stefan Monnier
Subject: [elpa] 145/299: Select mgs only if it's functional for non-MikTeX apps.
Date: Sun, 02 Nov 2014 03:10:59 +0000

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

commit f46e804dc0142cb3875b01be1ca1b01b40cf8bfd
Author: Tassilo Horn <address@hidden>
Date:   Mon Jul 1 08:51:06 2013 +0200

    Select mgs only if it's functional for non-MikTeX apps.
    
    * preview.el (preview-gs-command): Test `mgs' for functionality
    before using it.
---
 preview/ChangeLog  |    5 +++++
 preview/preview.el |    8 ++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/preview/ChangeLog b/preview/ChangeLog
index 8d057fe..914a7b2 100644
--- a/preview/ChangeLog
+++ b/preview/ChangeLog
@@ -1,3 +1,8 @@
+2013-07-01  Tassilo Horn  <address@hidden>
+
+       * preview.el (preview-gs-command): Test `mgs' for functionality
+       before using it.
+
 2013-06-29  Tassilo Horn  <address@hidden>
 
        * preview.el (preview-gs-command): Prefer the TeX distro
diff --git a/preview/preview.el b/preview/preview.el
index 77ebaab..db91109 100644
--- a/preview/preview.el
+++ b/preview/preview.el
@@ -347,8 +347,12 @@ LIST consists of TeX dimensions in sp (1/65536 TeX point)."
 (defcustom preview-gs-command
   (or ;; The GS wrapper coming with TeX Live
       (executable-find "rungs")
-      ;; The GS wrapper coming with MikTeX
-      (executable-find "mgs")
+      ;; The MikTeX builtin GS
+      (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 -dNOPAUSE -dBATCH")))
+         gs))
       ;; Windows ghostscript
       (executable-find "GSWIN32C.EXE")
       ;; standard GhostScript



reply via email to

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