[PATCH 2/3] test: Add `test_emacs_expect_t'.

Tomi Ollila tomi.ollila at iki.fi
Thu Jan 19 03:01:23 PST 2012


On Thu, 19 Jan 2012 10:42:31 +0000, David Edmondson <dme at dme.org> wrote:
> On Thu, 19 Jan 2012 12:32:21 +0200, Tomi Ollila <tomi.ollila at iki.fi> wrote:
> > Consider the following:
> > 
> > $ emacsclient --eval '(print "$(echo rm -rf /); echo `date +%Y`")'
> > "$(echo rm -rf /); echo `date +%Y`"
> 
> Or:
> 
> $ emacsclient --eval '(shell-command "rm -rf /")'
> 
> What's your point?

The point it that you need to quote all shell metacharacters 
(at least '$', '`', ';' and '&') always in your test output for eval:ing...
Writing to file from elisp test function for comparison is simpler.

Tomi


More information about the notmuch mailing list