emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Batch execution and --script


From: Marcelo de Moraes Serpa
Subject: Re: [O] Batch execution and --script
Date: Wed, 29 Aug 2012 13:35:45 -0500

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 <address@hidden> wrote:
Nick Daly <address@hidden> wrote:

> On Wed, Aug 29, 2012 at 10:47 AM, Marcelo de Moraes Serpa
> <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]