I think the problem is in the org-mode code that interprets "%s." (and how this interacts with my bash shell). This is supposed to pass the executable the fully qualified file name, but somehow it ends up passing the directory twice, which (understandably) confuses the executable.
While this seems to have something to do with the bash shell I'm using, this works fine for everything else, so I'm pretty sure there's no fundamental problem in my setup, and it would be nice to find a way around this problem. Two thoughts: 1) Is there another string I could use, instead of %s, that results in the file name being passed without the path at all? This would probably cure the problem. 2) If not, where is the code that interprets %s? I can try stepping through it and see what I can find. Thanks a lot. Richard > -----Original Message----- > From: nicholas.do...@hp.com [mailto:nicholas.do...@hp.com] > Sent: Saturday, May 12, 2012 7:40 AM > To: Jonathan Leech-Pepin > Cc: Richard Stanton; email@example.com > Subject: Re: [O] Problem exporting to PDF (and viewing) > > Jonathan Leech-Pepin <jonathan.leechpe...@gmail.com> wrote: > > > I suspect you should be able to get it to recognize "C:/Program\ > > Files/sumatrapdf/sumatrapdf.exe". > > > > Alternately if the exe is found on your PATH (you may need to add it > > by hand), you should be able to manage with: > > > > (executable-find "sumatrapdf.exe") > > > > which should be able to track back the path to the appropriate file. > > > > On Sat, May 12, 2012 at 12:10 AM, Richard Stanton > > <stan...@haas.berkeley.edu> wrote: > > > Checking further, this works fine using the default Windows shell in > Emacs, but fails if I use bash as my shell. Unfortunately, I like to use bash, > which I achieve with the following lines in my init.el: > > > > > > (setq shell-file-name "bash") > > > (setenv "SHELL" shell-file-name) > > > (setq explicit-shell-file-name shell-file-name) > > > > > >> -----Original Message----- > > >> From: Richard Stanton > > >> Sent: Friday, May 11, 2012 4:52 PM > > >> To: firstname.lastname@example.org > > >> Subject: Problem exporting to PDF (and viewing) > > >> > > >> Using Org-mode version 7.8.09 (release_7.8.09-553-g5750f0) (and > > >> earlier > > >> versions) I've encountered a problem on my Windows machine when I > > >> try to export an Org file to LaTeX, then to Pdf, then viewing (using C-c > > >> C- > e d). > > >> > > >> In my init.el I have the lines > > >> > > >> (eval-after-load "org" > > >> '(progn > > >> (if (assoc "\\.pdf\\'" org-file-apps) > > >> (setcdr (assoc "\\.pdf\\'" org-file-apps) > > >> "c:/progra~1/sumatrapdf/sumatrapdf.exe %s") > > >> (add-to-list 'org-file-apps '("\\.pdf\\'" . > > >> "c:/progra~1/sumatrapdf/sumatrapdf.exe %s") t)))) > > >> ) > > >> > > >> This results in: > > >> > > >> org-file-apps is a variable defined in `org.el'. > > >> Its value is ((auto-mode . emacs) > > >> ("\\.mm\\'" . default) > > >> ("\\.x?html?\\'" . default) > > >> ("\\.pdf\\'" . "c:/progra~1/sumatrapdf/sumatrapdf.exe %s")) > > >> > > >> When I try to export an org file by typing C-c C-e d, sumatrapdf > > >> opens up OK, but complains with an error like this: > > >> > > >> Error loading c:\dropbox\org\c\:\dropbox\org\personal.pdf > > >> > > >> Any idea why I get the repeated path? A similar constructions works > > >> fine on my Mac, so I'm not quite sure what's going wrong here. > > I don't do Windoze, but this looks to me like a typo in some init file, > perhaps a > missing semicolon? I'd grep the usual suspects (on Linux, this would be > /etc/*, and all the config/init files and directories under $HOME (.profile, > .bashrc, .emacs, etc etc), but I have no idea what these would be on > Windoze - you might even have to search the *shudder* > registry) for c:\dropbox\org. > > Nick