From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ken Mankoff Subject: Re: Macro that calls external program Date: Mon, 11 Mar 2019 20:24:04 +0100 Message-ID: <87va0prz8r.fsf@geus3064linuxwsm.geus.dk> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([209.51.188.92]:34199) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Qac-000408-5U for emacs-orgmode@gnu.org; Mon, 11 Mar 2019 15:27:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3QWv-0005va-2x for emacs-orgmode@gnu.org; Mon, 11 Mar 2019 15:24:09 -0400 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]:45773) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3QWu-0005uz-S1 for emacs-orgmode@gnu.org; Mon, 11 Mar 2019 15:24:09 -0400 Received: by mail-lf1-x136.google.com with SMTP id f16so140760lfk.12 for ; Mon, 11 Mar 2019 12:24:08 -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" To: Josh Cc: emacs-orgmode@gnu.org 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.