emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Macro that calls external program


From: Josh
Subject: Re: [O] Macro that calls external program
Date: Mon, 11 Mar 2019 06:28:59 -0700 (PDT)
User-agent: Alpine 2.21 (LRH 202 2017-01-01)

Thanks Ken.

Yes, at first I was trying to accomplish my task with Macros, but after finding out that I could run the whole Org file through a pre-filter, I realized that this would be a much cleaner and easier way rather than having multiple types of macros or code blocks. So now I'm trying to figure out how to attach an external program to `org-export-before-parsing-hook' or `org-export-before-processing-hook' to pipe the entire Org file through...

Josh

On Mon, 11 Mar 2019, Ken Mankoff wrote:

Hi Josh,

On 2019-03-10 at 23:37 +0100, Josh <address@hidden> wrote...
I am new to emacs and orgmode. I spent the last couple days reading
most of the docs before diving in,

Welcome!

but I didn't see anywhere how I could have a macro that instead of
replacing the macro with lisp code, calls an external program instead.

Something like:
#+MACRO: func   call /home/josh/mybinary $1

{{{func(Text Argument)}}}

and this would be setup to call an external program and the output of
the program would replace the macro on export.

/home/josh/mybinary "Text Argument"

I do wonder if you're asking an XY problem, especially after reading your 
follow-up question about running an entire Org file through a pre-filter.

Why does it have to be a macro that you call? Why not #+NAME:'d Babel code 
block, which can (presumably) run any program you want.

 -k.




reply via email to

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