Hi Nick,

Thanks for turning it into a concise example :)

Is that somewhere in the manual or Worg? Perhaps it should be added. I never contributed to Worg, I will look into how tonight.

This is a subject that should be explored more. I see a lot of potential in having CLI .el scripts (i.e taking the emacs GUI out of the equation).

- Marcelo.


On Wed, Aug 29, 2012 at 1:29 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
Nick Daly <nick.m.daly@gmail.com> wrote:

> On Wed, Aug 29, 2012 at 10:47 AM, Marcelo de Moraes Serpa
> <celoserpa@gmail.com> wrote:
> > Hey guys,
> >
> > Regarding this: http://orgmode.org/manual/Batch-execution.html
> >
> > I also had success using --script, as in:
> >
> > #!/Applications/Emacs.app/Contents/MacOS/Emacs --script
> >
> > In the top of a .el file. You can then chmod it to be executable and run it.
>
> Would you mind sharing a simple .el file you'd use that way?  The
> site's example is a bash script, and I wonder how much cleaner a .el
> file would be.
>

Marcelo posted a larger example, but maybe a very small example might be
helpful. Put the following in some file (I called it hello.el but the
name does not really matter):

--8<---------------cut here---------------start------------->8---
#! /usr/local/bin/emacs --script

(message "Hello World!")
--8<---------------cut here---------------end--------------->8---

Make it executable:

  chmod +x hello.el

and run it:

  ./hello.el

Nick