GNU bug report logs - #32251
[Windows] Cannot locate gs when the path contains space

Previous Next

Package: auctex;

Reported by: Jian Wang <jianwang.academic <at> gmail.com>

Date: Mon, 23 Jul 2018 18:55:01 UTC

Severity: normal

Tags: fixed

Done: Ikumi Keita <ikumi <at> ikumi.que.jp>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 32251 in the body.
You can then email your comments to 32251 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-auctex <at> gnu.org:
bug#32251; Package auctex. (Mon, 23 Jul 2018 18:55:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jian Wang <jianwang.academic <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-auctex <at> gnu.org. (Mon, 23 Jul 2018 18:55:01 GMT) Full text and rfc822 format available.

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

From: Jian Wang <jianwang.academic <at> gmail.com>
To: bug-auctex <at> gnu.org
Subject: [Windows] Cannot locate gs when the path contains space
Date: Tue, 24 Jul 2018 00:56:22 +0800
[Message part 1 (text/plain, inline)]
Hi, all

When I try to preview on windows, the Ghostscript executable bundled with
MiKTeX cannot be located since the path of MiKTeX contains a space. Thus
when I open a tex buffer there will be an echoed message telling me
''c:/Program" is not a valid command.

I fixed this issue by making the following change:

(defcustom preview-gs-command
  (or ;; The GS wrapper coming with TeX Live
   (executable-find "rungs")
   ;; 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 (and gs (= 0 (shell-command (concat (shell-quote-argument gs) " -q
-dNODISPLAY -c quit"))))
     gs))
   ;; Windows ghostscript
   (executable-find "GSWIN32C.EXE")
   ;; standard GhostScript
   (executable-find "gs"))
  "*How to call gs for conversion from EPS.  See also `preview-gs-options'."
  :group 'preview-gs
  :type 'string)


I wrap the 'gs' variable with a 'shell-quote-argument' and voila! I hope
this would be helpful for those who had the same issue.

Best regards,

James
[Message part 2 (text/html, inline)]

Information forwarded to bug-auctex <at> gnu.org:
bug#32251; Package auctex. (Wed, 31 Oct 2018 08:19:01 GMT) Full text and rfc822 format available.

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

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: Jian Wang <jianwang.academic <at> gmail.com>
Cc: 32251 <at> debbugs.gnu.org
Subject: Re: bug#32251: [Windows] Cannot locate gs when the path contains space
Date: Wed, 31 Oct 2018 17:18:50 +0900
Hi Jian, sorry for very late response.

>>>>> Jian Wang <jianwang.academic <at> gmail.com> writes:
> Hi, all
> When I try to preview on windows, the Ghostscript executable bundled with
> MiKTeX cannot be located since the path of MiKTeX contains a space. Thus
> when I open a tex buffer there will be an echoed message telling me
> ''c:/Program" is not a valid command.

> I fixed this issue by making the following change:

> (defcustom preview-gs-command
>   (or ;; The GS wrapper coming with TeX Live
>    (executable-find "rungs")
>    ;; 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 (and gs (= 0 (shell-command (concat (shell-quote-argument gs) " -q
> -dNODISPLAY -c quit"))))
>      gs))
>    ;; Windows ghostscript
>    (executable-find "GSWIN32C.EXE")
>    ;; standard GhostScript
>    (executable-find "gs"))
>   "*How to call gs for conversion from EPS.  See also `preview-gs-options'."
>   :group 'preview-gs
>   :type 'string)

Thank you for your contribution, I incorporated the above change into
the git repository.

Best regards,
Ikumi Keita




Added tag(s) fixed. Request was from Ikumi Keita <ikumi <at> ikumi.que.jp> to control <at> debbugs.gnu.org. (Thu, 01 Nov 2018 06:06:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 32251 <at> debbugs.gnu.org and Jian Wang <jianwang.academic <at> gmail.com> Request was from Ikumi Keita <ikumi <at> ikumi.que.jp> to control <at> debbugs.gnu.org. (Thu, 01 Nov 2018 06:06:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 29 Nov 2018 12:24:05 GMT) Full text and rfc822 format available.

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

Previous Next


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