all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marcelo de Moraes Serpa <celoserpa@gmail.com>
To: Nick Daly <nick.m.daly@gmail.com>
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: Batch execution and --script
Date: Wed, 29 Aug 2012 12:50:40 -0500	[thread overview]
Message-ID: <CACHMzOHz0L2zBSa-HQb_Tj9SOpvF3ps4m+xsB6-nwvCgj8CRWw@mail.gmail.com> (raw)
In-Reply-To: <CAM-YhhDHOOboMwUNS6zzOojOH_t6eNmTJ5pQ01hqb_kDQeum5g@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1529 bytes --]

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 <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.
>
> Nick
>

[-- Attachment #2: Type: text/html, Size: 2315 bytes --]

  reply	other threads:[~2012-08-29 17:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-29 15:47 Batch execution and --script Marcelo de Moraes Serpa
2012-08-29 16:42 ` Nick Daly
2012-08-29 17:50   ` Marcelo de Moraes Serpa [this message]
2012-08-30  5:34     ` Bastien
2012-11-28  2:18       ` Bernt Hansen
2012-12-04 14:25         ` Bastien
2012-08-29 18:29   ` Nick Dokos
2012-08-29 18:35     ` Marcelo de Moraes Serpa
2012-08-29 18:59       ` Thorsten Jolitz
2012-08-29 19:13       ` Nick Dokos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACHMzOHz0L2zBSa-HQb_Tj9SOpvF3ps4m+xsB6-nwvCgj8CRWw@mail.gmail.com \
    --to=celoserpa@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=nick.m.daly@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.