GNU bug report logs - #36357
Wrong Ghostscript program name on MS Win

Previous Next

Package: emacs;

Reported by: Sebastian Urban <mrsebastianurban <at> gmail.com>

Date: Mon, 24 Jun 2019 16:05:02 UTC

Severity: minor

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #53 received at 36357 <at> debbugs.gnu.org (full text, mbox):

From: Tassilo Horn <tsdh <at> gnu.org>
To: Sebastian Urban <mrsebastianurban <at> gmail.com>
Cc: Arash Esbati <arash <at> gnu.org>, Eli Zaretskii <eliz <at> gnu.org>,
 36357 <at> debbugs.gnu.org
Subject: Re: bug#36357: Wrong Ghostscript program name on MS Win
Date: Tue, 21 Apr 2020 20:34:41 +0200
Sebastian Urban <mrsebastianurban <at> gmail.com> writes:

> To sum things up "doc-view-ghostscript-program" could look like this:
>
> (defcustom doc-view-ghostscript-program
>   (cond
>    ((executable-find "gswin64c.exe") "gswin64c")
>    ((executable-find "gswin32c.exe") "gswin32c")
>    (t "gs"))
>   "Program to convert PS and PDF files to PNG."
>   :type 'file
>   :version "27.1")

Why not use the return value of executable-find?  Is there a benefit in
using the non-qualified executable?  I've seen that there are other such
occurrences is doc-view.el... I'd just go with:

(defcustom doc-view-ghostscript-program
  (or
   (executable-find "gswin64c")
   (executable-find "gswin32c")
   "gs")
  "Program to convert PS and PDF files to PNG."
  :type 'file
  :version "27.1")

> PS If it's alright could it be installed in 27.1?  It's not that big
> of a change.

I tend to agree but that's to be decided by Eli (in Cc).  That would be
the complete diff from the current version:

--8<---------------cut here---------------start------------->8---
diff -u --label /home/horn/Repos/el/emacs/lisp/doc-view.el --label \#\<buffer\ doc-view.el\> /home/horn/Repos/el/emacs/lisp/doc-view.el /tmp/buffer-content-MettTK
--- /home/horn/Repos/el/emacs/lisp/doc-view.el
+++ #<buffer doc-view.el>
@@ -153,11 +153,10 @@
   :prefix "doc-view-")
 
 (defcustom doc-view-ghostscript-program
-  (cond
-   ((memq system-type '(windows-nt ms-dos))
-    "gswin32c")
-   (t
-    "gs"))
+  (or
+   (executable-find "gswin64c")
+   (executable-find "gswin32c")
+   "gs")
   "Program to convert PS and PDF files to PNG."
   :type 'file
   :version "27.1")
--8<---------------cut here---------------end--------------->8---

Bye,
Tassilo




This bug report was last modified 5 years and 31 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.