From mboxrd@z Thu Jan 1 00:00:00 1970 From: Josh Subject: Re: Macro that calls external program Date: Mon, 11 Mar 2019 04:19:47 -0700 (PDT) Message-ID: References: <87pnqxsvir.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII Return-path: Received: from eggs.gnu.org ([209.51.188.92]:55266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3PxX-0000zQ-HE for emacs-orgmode@gnu.org; Mon, 11 Mar 2019 14:47:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3Pkj-0007vb-Ni for emacs-orgmode@gnu.org; Mon, 11 Mar 2019 14:34:22 -0400 Received: from colo.shuman.org ([204.238.213.178]:37428) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Pkj-0007uo-H9 for emacs-orgmode@gnu.org; Mon, 11 Mar 2019 14:34:21 -0400 Received: from localhost (localhost [127.0.0.1]) by colo.shuman.org (Postfix) with ESMTP id 981326030583 for ; Mon, 11 Mar 2019 04:19:47 -0700 (PDT) In-Reply-To: <87pnqxsvir.fsf@gmail.com> 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" Cc: emacs-orgmode@gnu.org Thanks! This is very helpful. I have a related question. How can I run an external program right before Export that takes as input the current buffer and prints out to stdout an updated version of the org file that then is exported? Basically I want to pipe the org file through a filter that is an external program before it is exported. Thanks in advance! Josh > On Sunday, 10 Mar 2019 at 15:37, Josh wrote: >> Hi, >> >> I am new to emacs and orgmode. I spent the last couple days reading most >> of the docs before diving in, 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 > > You could maybe do something along the lines of > > #+macro: func (eval (shell-command (concat "/home/josh/mybinary " "$1"))) > > (untested). > > -- > Eric S Fraga via Emacs 27.0.50, Org release_9.2.2-249-g51444a >