Subject: Re: bug#36357: Wrong Ghostscript program name on MS Win

From: Tassilo Horn <[email-masked]>
Date: Tue, 21 Apr 2020 20:34:41 +0200

Sebastian Urban <[email-masked]> 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