all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Arash Esbati <arash@gnu.org>
To: Sebastian Urban <mrsebastianurban@gmail.com>,
	Tassilo Horn <tsdh@gnu.org>
Cc: 36357@debbugs.gnu.org
Subject: bug#36357: Wrong Ghostscript program name on MS Win
Date: Tue, 21 Apr 2020 15:16:30 +0200	[thread overview]
Message-ID: <86d0817zdd.fsf@gnu.org> (raw)
In-Reply-To: <86y2qpj2nv.fsf@gnu.org> (Arash Esbati's message of "Mon, 20 Apr 2020 22:57:40 +0200")

[-- Attachment #1: Type: text/plain, Size: 331 bytes --]

Arash Esbati <arash@gnu.org> writes:

> I don't use doc-view, so I can't really tell, but preview.el (part of
> AUCTeX) uses "executable-find".  Applied to
> `doc-view-ghostscript-program', it could look like this:

Following up myself, I suggest the patch attached.

@Tassilo: What do you think, does it make sense?

Best, Arash


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Improve-detection-of-Ghostscript-executable.patch --]
[-- Type: text/x-patch, Size: 1564 bytes --]

From 2b7bdf2b905271d1fd7c4d4af8a305ff40a50f05 Mon Sep 17 00:00:00 2001
From: Arash Esbati <arash@gnu.org>
Date: Tue, 21 Apr 2020 15:01:08 +0200
Subject: [PATCH] Improve detection of Ghostscript executable

* lisp/doc-view.el (doc-view-ghostscript-program): Add better
support for detection of Ghostscript executable on non-free
systems.  (bug#36357)
---
 lisp/doc-view.el | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index 8b3d5527f0..eddcd884dd 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -154,13 +154,29 @@ doc-view
 
 (defcustom doc-view-ghostscript-program
   (cond
-   ((memq system-type '(windows-nt ms-dos))
+   ;; The GS wrapper coming with TeX Live
+   ((executable-find "rungs.exe")
+    "rungs")
+   ;; The MikTeX builtin GS
+   ;; Check if mgs is functional for external non-MikTeX apps.  Was
+   ;; available under:
+   ;; http://blog.miktex.org/post/2005/04/07/Starting-mgsexe-at-the-DOS-Prompt.aspx
+   ((and (executable-find "mgs.exe")
+         (= 0 (shell-command
+               (concat (shell-quote-argument (executable-find "mgs.exe"))
+                       " -q -dNODISPLAY -c quit"))))
+    "mgs")
+   ;; Windows Ghostscript
+   ((executable-find "gswin64c.exe")
+    "gswin64c")
+   ((executable-find "gswin32c.exe")
     "gswin32c")
+   ;; Standard Ghostscript
    (t
     "gs"))
   "Program to convert PS and PDF files to PNG."
   :type 'file
-  :version "27.1")
+  :version "28.1")
 
 (defcustom doc-view-pdfdraw-program
   (cond
-- 
2.26.2


  reply	other threads:[~2020-04-21 13:16 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-24 16:04 bug#36357: Wrong Ghostscript program name on MS Win Sebastian Urban
2019-07-06  8:13 ` Eli Zaretskii
2019-07-06 11:29   ` Tassilo Horn
2019-07-06 11:52     ` Eli Zaretskii
2019-07-06 11:51 ` Eli Zaretskii
2020-03-18 17:26   ` Sebastian Urban
2020-03-18 18:25     ` Eli Zaretskii
2020-03-18 19:23       ` Sebastian Urban
2020-04-13 19:10         ` Sebastian Urban
2020-04-20 20:57           ` Arash Esbati
2020-04-21 13:16             ` Arash Esbati [this message]
2020-04-21 13:19               ` Tassilo Horn
2020-04-21 13:25                 ` Arash Esbati
2020-04-21 17:51                   ` Sebastian Urban
2020-04-21 18:34                     ` Tassilo Horn
2020-04-21 18:48                       ` Eli Zaretskii
2020-04-21 20:29                     ` Arash Esbati
2020-04-22  9:05                       ` Tassilo Horn
2020-04-22 10:07                         ` Sebastian Urban
2020-04-22 13:00                           ` Tassilo Horn
2020-04-22 13:50                           ` Eli Zaretskii
2020-04-22 13:45                         ` Eli Zaretskii
2020-04-22 14:14                           ` Tassilo Horn
2020-04-22 14:32                             ` Eli Zaretskii
2020-04-22 17:29                               ` Tassilo Horn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86d0817zdd.fsf@gnu.org \
    --to=arash@gnu.org \
    --cc=36357@debbugs.gnu.org \
    --cc=mrsebastianurban@gmail.com \
    --cc=tsdh@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.