From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo de Moraes Serpa Subject: Re: Batch execution and --script Date: Wed, 29 Aug 2012 12:50:40 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=20cf300fb3bd772b0e04c86b3273 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:33802) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6mPa-00051q-GV for emacs-orgmode@gnu.org; Wed, 29 Aug 2012 13:50:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T6mPZ-0002GG-6I for emacs-orgmode@gnu.org; Wed, 29 Aug 2012 13:50:42 -0400 Received: from mail-qc0-f169.google.com ([209.85.216.169]:42110) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6mPZ-0002GC-1g for emacs-orgmode@gnu.org; Wed, 29 Aug 2012 13:50:41 -0400 Received: by qcsd16 with SMTP id d16so714742qcs.0 for ; Wed, 29 Aug 2012 10:50:40 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nick Daly Cc: Org Mode --20cf300fb3bd772b0e04c86b3273 Content-Type: text/plain; charset=ISO-8859-1 Sure! Bear in mind I'm not an elisp expert, and I got it working after a lot of trial and error. I'm using this script as part of a quickblogging engine I'm writing for org (still testing, will share once it works as expected) so that I can blog from directly from my journal org file to a jekyll blog. I also created a new function based off org-export-generic called org-export-generic-markdown which can be called in a non-interactive way, so that it could work from the script. The script basically exports a specific org file to markdown (in the same dir the org file is located). Now I want to make it accept command-line arguments. I will check it out tonight. Here it goes: http://pastie.org/4611632 This is pretty powerful, as you can also return data from the script by using princ. I can imagine millions of ways this could be used to integrate org with other apps/languages. - Marcelo. On Wed, Aug 29, 2012 at 11:42 AM, Nick Daly wrote: > On Wed, Aug 29, 2012 at 10:47 AM, Marcelo de Moraes Serpa > 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. > > Nick > --20cf300fb3bd772b0e04c86b3273 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Sure!

Bear in mind I'm not an elisp expert, and I go= t it working after a lot of trial and error. I'm using this script as p= art of a quickblogging engine I'm writing for org (still testing, will = share once it works as expected) so that I can blog from directly from my j= ournal org file to a jekyll blog.

I also created a new function based off org-export-gene= ric called org-export-generic-markdown which can be called in a non-interac= tive way, so that it could work from the script.

The script basically exports a specific org file to markdown (in the same d= ir the org file is located). Now I want to make it accept command-line argu= ments. I will check it out tonight.

Here it goes:<= /div>


This is pretty powerful, as you can a= lso return data from the script by using princ. I can imagine millions of w= ays this could be used to integrate org with other apps/languages.

- Marcelo.


On Wed, Aug 29, 2012 at 11:42 AM, Nick Daly &= lt;nick.m.daly@g= mail.com> wrote:
On Wed, Aug 29, 2012 at 10= :47 AM, Marcelo de Moraes Serpa
<celoserpa@gmail.com> wrot= e:
> 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 r= un it.

Would you mind sharing a simple .el file you'd use that way? =A0T= he
site's example is a bash script, and I wonder how much cleaner a .el file would be.

Nick

--20cf300fb3bd772b0e04c86b3273--