Nick Daly <nick.m.d...@gmail.com> wrote: > On Wed, Aug 29, 2012 at 10:47 AM, Marcelo de Moraes Serpa > <celose...@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