From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Failure exporting with emacs --batch Date: Tue, 15 Nov 2011 15:51:09 -0500 Message-ID: <2681.1321390269@alphaville.dokosmarshall.org> References: <87pqgt9wj7.fsf@hermes.hocat.ca> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([140.186.70.92]:40428) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RQPyL-0002DO-Fj for emacs-orgmode@gnu.org; Tue, 15 Nov 2011 15:51:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RQPyK-0007DL-G6 for emacs-orgmode@gnu.org; Tue, 15 Nov 2011 15:51:13 -0500 Received: from g1t0029.austin.hp.com ([15.216.28.36]:27424) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RQPyK-0007DE-9L for emacs-orgmode@gnu.org; Tue, 15 Nov 2011 15:51:12 -0500 In-Reply-To: Message from Herbert Sitz of "Tue, 15 Nov 2011 20:18:10 GMT." 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: Herbert Sitz Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org Herbert Sitz wrote: > Herbert Sitz gmail.com> writes: > > > > Not sure, but I do something similar with a single --eval: > > > > --eval '(progn (find-file "filename") (org-export-as-html-and-open 3) )' > > > > Except my version has double quotes for --eval argument and backslashes before > embedded quotes: > > --eval "(progn (find-file \"filename\") (org-export-as-html-and-open 3) )" > > That doesn't matter here: both of the above should work fine in a bash (or similar) shell environment. I prefer the single quote style in general, since it allows me to leave everything else unchanged[fn:1]. But shell quoting is a minefield: when you have to quote *parts* of an expression and leave other parts unquoted so that the shell can get to them (e.g. to evaluate shell variables and `...` or $(...) constructs), life starts to get difficult - and that's just the beginning[fn:2]. Nick Footnotes: [fn:1] ...unless there is a single quote in there. If I'm quoting lisp code that has a single quote, I generally write (quote foo) instead of 'foo, in order to avoid the quote mess. And often I'll just add a function to my minimal .emacs, so I can just write ... --eval '(foo)' ... on the command line: when writing foo, I don't have to worry about shell quoting rules. [fn:2] Kernighan and Pike, in their "The Unix Programming Environment", have an example on p. 128 where they remark: "The remarkable sequence of quote characters is required to capture the date in a string in the middle of the awk program." Worth taking a look if you have the book available nearby.