From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sean O'Halpin" Subject: Re: Macro and babel Date: Wed, 19 Sep 2012 07:54:06 +0100 Message-ID: References: <4A8C5CE2-9159-49BB-A6F9-1FB8B8EAD154@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:41273) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEEAk-000258-Kb for emacs-orgmode@gnu.org; Wed, 19 Sep 2012 02:54:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TEEAh-0001ge-HG for emacs-orgmode@gnu.org; Wed, 19 Sep 2012 02:54:10 -0400 Received: from mail-pb0-f41.google.com ([209.85.160.41]:56486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEEAh-0001gV-BQ for emacs-orgmode@gnu.org; Wed, 19 Sep 2012 02:54:07 -0400 Received: by pbbro12 with SMTP id ro12so1986861pbb.0 for ; Tue, 18 Sep 2012 23:54:06 -0700 (PDT) In-Reply-To: <4A8C5CE2-9159-49BB-A6F9-1FB8B8EAD154@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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: tony day Cc: Org-mode On Wed, Sep 19, 2012 at 1:54 AM, tony day wrote: > > I had written this: > > ,---- > | #+MACRO: testdir ~/working > | #+begin_src sh > | cd {{{testdir}}} > | #+end_src > `---- > > Thinking it would do this: > > ,---- > | #+begin_src sh > | cd ~/working > | #+end_src > `---- > Alas, #+Macro acts on export only. > > Is there a quick way to effect general text substitution on C-c C-c? That would be an awesome feature, basically adding macro capabilities to every babelable language. Or am I missing something? > > > Tony Here's a somewhat roundabout way of achieving something similar: #+BEGIN_ORG #+NAME: test-dir2 #+BEGIN_SRC sh :var dir="." :results output org :exports none echo " ,#+begin_src sh cd $dir ,#+end_src " #+END_SRC #+CALL: test-dir2(dir="~/org") :results value raw :exports both #+CALL: test-dir2(dir="/var/www/") :results value raw :exports both #+END_ORG HTH, Sean