"start" is sort-of broken with arguments. See here for some oddities
associated with the Windows start command:

http://stackoverflow.com/questions/154075/using-the-dos-start-command-with-parameters-passed-to-the-started-program

It gives a work-around for what you're trying to do.


On Sun, Dec 22, 2013 at 7:25 PM, David Scott <d.scott@auckland.ac.nz> wrote:

>
> On 21/12/2013 7:52 p.m., Vitalie Spinu wrote:
>
>> Actually the code looks ok. The ess-pdf-viewer-pref should take
>> effect. Could you please report what is reported by
>>
>>     M-: (ess-get-pdf-viewer)
>>
> "SumatraPDF.exe"
>
>
>
>> Also check that if you call from emacs shell or windows terminal:
>>
>> start "c:/Program Files/RStudio/bin/sumatra/SumatraPDF.exe"
>> "some_file.pdf"
>>
>> it really works.
>>
> Opens the file with Adobe Reader!
>
> SumatraPDF "some_file.pdf"
> SumatraPDF.exe "some_file.pdf"
> both open the file with SumatraPDF.
>
>
>> You can inspect what is going wrong with ess-swv-PDF yourself. Go to
>> that function and instrument with C-u C-M-x. Then call it from rnw
>> buffer. The debugger will start and you should press n till you reach
>> the calling part. Then you can inspect all variables and expressions by
>> executing C-x C-e at the end of those.
>>
>>  It seems to have the right variable values all the time, but when it
> gets to
> (shell-command cmdstr-win)
> the pdf file just opens up with Adobe Reader. All the variables are
> showing SumatraPDF as what to use.
>
> I tried changing the viewer to just "SumatraPDF.exe"without the path for
> both Sweave and AUCTeX, based on the experiment in the shell above, but no
> joy. Just another wonderful feature of Windows I guess.
>
> In desperation I resorted to an ugly hack which seems to have worked. I
> commented out the line
> (shell-command cmdstr-win)
> in ess-swv.el and byte compiled the result. Now the pdf viewer is not
> invoked, but that is fine for me. I just open the pdf file with SumatraPDF
> before I use knitr and pdflatex.
>
> Thanks for the advice on debugging, it meant I was able to find the code
> which opened the pdf viewer.
>
>
> David Scott
>
>
>
> --
> _________________________________________________________________
> David Scott     Department of Statistics
>                 The University of Auckland, PB 92019
>                 Auckland 1142,    NEW ZEALAND
> Phone: +64 9 923 5055, or +64 9 373 7599 ext 85055
> Email:  d.scott@auckland.ac.nz,  Fax: +64 9 373 7018
>
> ______________________________________________
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help
>

	[[alternative HTML version deleted]]

