From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Problem exporting to PDF (and viewing) Date: Fri, 18 May 2012 17:11:10 -0400 Message-ID: <12464.1337375470@alphaville> References: <40C7B1BFC291ED4E9D10436D07736A33470478B315@EXMAIL7.haas.uc.berkeley.edu> <23805.1336833570@alphaville> <40C7B1BFC291ED4E9D10436D07736A33470478B372@EXMAIL7.haas.uc.berkeley.edu> <31430.1336884795@alphaville> <40C7B1BFC291ED4E9D10436D07736A33470478BC1E@EXMAIL7.haas.uc.berkeley.edu> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([208.118.235.92]:51281) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVUSC-0000uN-RX for emacs-orgmode@gnu.org; Fri, 18 May 2012 17:11:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SVUSA-0001ae-TA for emacs-orgmode@gnu.org; Fri, 18 May 2012 17:11:16 -0400 Received: from g1t0028.austin.hp.com ([15.216.28.35]:4983) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVUSA-0001aP-M0 for emacs-orgmode@gnu.org; Fri, 18 May 2012 17:11:14 -0400 In-Reply-To: Message from Richard Stanton of "Fri, 18 May 2012 13:56:19 PDT." <40C7B1BFC291ED4E9D10436D07736A33470478BC1E@EXMAIL7.haas.uc.berkeley.edu> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Richard Stanton Cc: "emacs-orgmode@gnu.org" , Jonathan Leech-Pepin Richard Stanton wrote: > > > 2) If not, where is the code that interprets %s? I can try stepping > > > through it and see what I can find. > > > > > > > It happens in org.el:org-open-file, specifically this piece of the code (I think): > > > > ,---- > > | (while (string-match "%s" cmd) > > | (setq cmd (replace-match > > | (save-match-data > > | (shell-quote-argument > > | (convert-standard-filename file))) > > | t t cmd))) > > `---- > > I did some tracing through, and have found where things go wrong. > > At the start of the code listed above, > > cmd = "c:/progra~1/sumatrapdf/sumatrapdf.exe %s" > file = "c:/dropbox/org/personal.pdf" > > (convert-standard-filename file) returns > "C:/dropbox/org/personal.pdf" > > So far so good... > > However, > > (shell-quote-argument (convert-standard-filename file)) returns > "c\\:dropbox/org/personal.pdf" > Does it really drop the slash in front of "dropbox"? When I do that on my system, the : is quoted, but the slash is left alone: (setq s "C:/dropbox/org/personal.pdf") "C:/dropbox/org/personal.pdf" (shell-quote-argument s) "C\\:/dropbox/org/personal.pdf" system-type gnu/linux If it does indeed drop the slash, can you try just putting it back and leaving the backslashes alone? Nick > That's where the problem occurs. After this block of code is completed, cmd takes the value > "c:/progra~1/sumatrapdf/sumatrapdf.exe c\\:dropbox/org/personal.pdf" > > This command causes sumatrapdf to squawk with an error. It's the "\\:" that causes the problem. If, after this block of code executes, I manually switch the "\\:" back to ":/", so cmd goes back to > > "c:/progra~1/sumatrapdf/sumatrapdf.exe c:/dropbox/org/personal.pdf" > > and then press "c" to continue, the PDF file pops up just fine. Could we just drop the call to shell-quote-argument? It seems like everything would work fine without this call. >