I strugle to give my emacs access to ghostscript (to make doc-view show me pdf previews), and seem lost in a plethora of internet advises about how to install gs. Here is what I have done, and it does not work yet:
- I have installed ghostscript at
C:\Program Files (x86)\gs\gs9.09\bin\gswin32.exe
I have set the environmental PATH to
C:\Program Files (x86)\gs\gs9.09\bin
In my emacs init file I have the following code:
(add-to-list 'load-path "C:/Program Files (x86)/gs/gs9.09/bin/")
(add-to-list 'load-path "C:/Program Files (x86)/gs/gs9.09/lib/")
When I give the following shell command from emacs
M-! gsview32
"gsview32" is not recognized as an internal or external command, operable program or batch file.
What is lacking in my setup above (and what is not needed)?
exec-path
, notload-path
. Also, how exactly did you set environment variables (through Windows dialog, or by callingsetenv
in Emacs?). What shell are you running in Emacs (is it Cygwin's bash or cmd.exe?). If it is cmd.exe, what happens if you type in shellwhere gsview32
?(setq doc-view-ghostscript-program "/path/to/gs")
In my experience, theexec-path
is for things like helping Emacs to create the*Completions*
buffer -- however, that is unrelated to helping Emacs find an executable to start a process as that relies upon the environmental variable for the$PATH
. You can see what your$PATH
by typing:M-x eval-expression RET (getenv "PATH") RET