[ESS] Oppening pdf files from ESS

Rodney Sparapani rsparapa at mcw.edu
Thu Nov 6 16:09:07 CET 2008

Vitalie Spinu wrote:
> Tanks a lot Kevin,
> It was indeed the line (shell-command (concat pdfviewer " " namestem 
> ".pdf &")))
> which did not do the job. I am using v.3.3.7 of ess and emacs 22.2.1. 
> Have seen the sources for 3.3.9, the old line is still there.
> The problem probably stems in "shell-command" not recognising spaces in 
> file names, for instance
> (shell-command (concat "c:/Program Files/Adobe/Reader 
> 8.0/Reader/AcroRd.exe" "D:/works/elsberg.pdf &"))
> returns
> 'c:/Program' is not recognized as an internal or external 
> command,operable program or batch file.
> Thanks once again,
> Vitalie.

Well, I don't know which version of ESS you have since the latest is 
5.3.8 (and the earliest that I recall was 5.x).  Anyways, embedded 
blanks must be escaped on Windows just like on Unix.  So, if it were a 
POSIX shell command (which would require something like Cygwin on Windows):

(concat "\"" pdfviewer "\" \"" namestem ".pdf\" &")

Or for Windows with a DOS shell:

(concat "start \"" pdfviewer "\" \"" namestem ".pdf\"")

If this works, then we can get it into the next release (5.3.9).

Rodney Sparapani      Center for Patient Care & Outcomes Research (PCOR)
Sr. Biostatistician              http://www.mcw.edu/pcor
4 wheels good, 2 wheels better!  Medical College of Wisconsin (MCW)
WWLD?:  What Would Lombardi Do?  Milwaukee, WI, USA

More information about the ESS-help mailing list