From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jarmo Hurri Subject: Re: Org src blocks and multiline macros Date: Thu, 02 Aug 2018 15:32:57 +0300 Message-ID: <871sbhaqyu.fsf@iki.fi> References: <87effhb7lu.fsf@iki.fi> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58588) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1flCn0-00077w-6E for emacs-orgmode@gnu.org; Thu, 02 Aug 2018 08:33:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1flCmx-0001o4-1H for emacs-orgmode@gnu.org; Thu, 02 Aug 2018 08:33:10 -0400 Received: from [195.159.176.226] (port=54572 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1flCmw-0001nO-P4 for emacs-orgmode@gnu.org; Thu, 02 Aug 2018 08:33:06 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1flCkm-0000Pr-V5 for emacs-orgmode@gnu.org; Thu, 02 Aug 2018 14:30:52 +0200 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 >> I am once again facing a situation where I would like to define a >> multiline org macro. > > > I'm not sure what that means, but based on your example a different > solution might work for you. > > 2. If not, could we have this feature? This would give us immediate >> multiline macros in the following style, where referring to the value >> of the variable could be done macro-style. >> >> #+HEADER: :var val1=foo >> #+BEGIN_SRC org :var val2=" bar" >> Currently this gives me nothing but {{{val1}}}{{{val2}}}. >> ... >> > > Org macros don't get evaluated inside src blocks as far as I know. But > Noweb might help you. Look for this feature in Org manual. I use Noweb as > "macros for src blocks". Yep, that will give me something similar: #+name: val1 #+BEGIN_SRC org :exports none foo #+END_SRC #+name: val2 #+BEGIN_SRC org :exports none bar #+END_SRC #+BEGIN_SRC org :noweb yes Currently this gives me ~<><>~ indeed! #+END_SRC Compared to multiline macros, though, having to (re)define bunch of src blocks for variables does seem like an overkill. BTW, does anyone know how I could enforce the standard Org-interpretation of '~' in the resulting, exported Org. Jarmo