From mboxrd@z Thu Jan 1 00:00:00 1970 From: Josh Subject: Re: Macro that calls external program Date: Mon, 11 Mar 2019 06:28:59 -0700 (PDT) Message-ID: References: <87va0prz8r.fsf@geus3064linuxwsm.geus.dk> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII Return-path: Received: from eggs.gnu.org ([209.51.188.92]:50368) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Rll-0001hu-4m for emacs-orgmode@gnu.org; Mon, 11 Mar 2019 16:43:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3Rlk-0002DW-3j for emacs-orgmode@gnu.org; Mon, 11 Mar 2019 16:43:33 -0400 Received: from colo.shuman.org ([204.238.213.178]:39366) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Rlj-0002D3-QP for emacs-orgmode@gnu.org; Mon, 11 Mar 2019 16:43:31 -0400 Received: from localhost (localhost [127.0.0.1]) by colo.shuman.org (Postfix) with ESMTP id 98A586030583 for ; Mon, 11 Mar 2019 06:28:59 -0700 (PDT) In-Reply-To: <87va0prz8r.fsf@geus3064linuxwsm.geus.dk> 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" To: emacs-orgmode@gnu.org 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 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. >