unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tsdh@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: arash@gnu.org, mrsebastianurban@gmail.com, 36357-done@debbugs.gnu.org
Subject: bug#36357: Wrong Ghostscript program name on MS Win
Date: Wed, 22 Apr 2020 19:29:30 +0200	[thread overview]
Message-ID: <87a733sa2t.fsf@gnu.org> (raw)
In-Reply-To: <83sggvegl9.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 22 Apr 2020 17:32:34 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Tassilo Horn <tsdh@gnu.org>
>> Cc: arash@gnu.org,  mrsebastianurban@gmail.com,  36357@debbugs.gnu.org
>> Date: Wed, 22 Apr 2020 16:14:41 +0200
>> 
>> > It is IME wrong and user-unfriendly to refuse to load foo.bat or
>> > foo.cmd and insist on running foo.exe.  The reason is that having a
>> > batch file that shadows a .exe program is the easiest way of
>> > "customizing" programs, like adding default arguments, setting up a
>> > special PATH value, etc.
>> 
>> I agree, and I will omit the extension at least for gs{64,32}winc.  The
>> question is more how likely it is that some user has her own "rungs"
>> command/batch script which has nothing to do with "running GhostScript"
>> and then we call it in doc-view.  I mean, "rungs" is at least an English
>> word...
>
> I think it's unlikely.  E.g., on my system there's not a single file
> that goes by the name "rungs" with any extension.  Another data point
> is that package authors generally try to choose names for their
> programs that don't clash with existing popular programs.  So I think
> you could stop worrying about this.

Ok, thank you all, that's the patch I've eventually pushed to emacs-27.

--8<---------------cut here---------------start------------->8---
@@ -155,9 +155,21 @@ doc-view
 (defcustom doc-view-ghostscript-program
   (cond
    ((memq system-type '(windows-nt ms-dos))
-    "gswin32c")
-   (t
-    "gs"))
+    (or
+     ;; Windows Ghostscript
+     (executable-find "gswin64c")
+     (executable-find "gswin32c")
+     ;; The GS wrapper coming with TeX Live
+     (executable-find "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
+     (when-let ((mgs (executable-find "mgs")))
+       (when (= 0 (shell-command
+                   (concat (shell-quote-argument mgs)
+                           " -q -dNODISPLAY -c quit")))
+         mgs))))
+   (t "gs"))
   "Program to convert PS and PDF files to PNG."
   :type 'file
   :version "27.1")
--8<---------------cut here---------------end--------------->8---

Eli, I guess some brave soul merges from emacs-27 to master from time to
time, so there's nothing more I have to do, right?

Bye,
Tassilo





      reply	other threads:[~2020-04-22 17:29 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
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 [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87a733sa2t.fsf@gnu.org \
    --to=tsdh@gnu.org \
    --cc=36357-done@debbugs.gnu.org \
    --cc=arash@gnu.org \
    --cc=eliz@gnu.org \
    --cc=mrsebastianurban@gmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).