emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Herbert Sitz <hesitz@gmail.com>
Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org
Subject: Re: Failure exporting with emacs --batch
Date: Tue, 15 Nov 2011 15:51:09 -0500	[thread overview]
Message-ID: <2681.1321390269@alphaville.dokosmarshall.org> (raw)
In-Reply-To: Message from Herbert Sitz <hesitz@gmail.com> of "Tue, 15 Nov 2011 20:18:10 GMT." <loom.20111115T211644-310@post.gmane.org>

Herbert Sitz <hesitz@gmail.com> wrote:

> Herbert Sitz <hesitz <at> 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.

  reply	other threads:[~2011-11-15 20:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-15 16:32 Failure exporting with emacs --batch Tom Prince
2011-11-15 20:09 ` Herbert Sitz
2011-11-15 20:18   ` Herbert Sitz
2011-11-15 20:51     ` Nick Dokos [this message]
2011-11-15 21:09       ` Herbert Sitz
2011-11-15 21:48         ` Nick Dokos
2011-11-15 20:21 ` Eric Schulte
2011-11-15 20:30 ` Nick Dokos
2011-11-16  0:36   ` Tom Prince
2011-11-16  3:33     ` Nick Dokos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2681.1321390269@alphaville.dokosmarshall.org \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=hesitz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).