From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: macro replacement in code block? Date: Wed, 01 Nov 2017 18:48:46 +0000 Message-ID: References: <17470BC7-0FB7-458A-AE92-30EC6A7A303F@therogoffs.com> <95C792B0-79AC-4F65-B07B-F7787D25352D@therogoffs.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a11488d16fdaecf055cf0529f" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e9y4R-0000qO-Nd for emacs-orgmode@gnu.org; Wed, 01 Nov 2017 14:49:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e9y4Q-0005s3-ST for emacs-orgmode@gnu.org; Wed, 01 Nov 2017 14:48:59 -0400 Received: from mail-yw0-x235.google.com ([2607:f8b0:4002:c05::235]:52373) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e9y4Q-0005rl-Mo for emacs-orgmode@gnu.org; Wed, 01 Nov 2017 14:48:58 -0400 Received: by mail-yw0-x235.google.com with SMTP id w2so2660172ywa.9 for ; Wed, 01 Nov 2017 11:48:58 -0700 (PDT) In-Reply-To: <95C792B0-79AC-4F65-B07B-F7787D25352D@therogoffs.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" To: David Rogoff Cc: emacs-org list --001a11488d16fdaecf055cf0529f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Nov 1, 2017 at 1:32 PM David Rogoff wrote: > Thanks so much. It sort of works but with a bit of work-around: > Great! > 2) for export, I had to move the > > ,#+MACRO: SEC_FOO > > lines out of the code block. If I didn=E2=80=99t and tried to eval that = block, I > got the error > > No org-babel-execute function for org! > You just need to add org as an org babel language: (let (ob-lang-alist) (add-to-list 'ob-lang-alist '(org . t)) (org-babel-do-load-languages 'org-babel-load-languages ob-lang-alist)) You don't necessarily need the let form above, but that is in a form that allows easily adding more languages in future. --=20 Kaushal Modi --001a11488d16fdaecf055cf0529f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Nov 1,= 2017 at 1:32 PM David Rogoff <d= avid@therogoffs.com> wrote:
=
Thanks so much.=C2=A0 It sort of works but with a bit of = work-around:

Great!
=C2=A0<= /div>
2) for export, I= had to move the=C2=A0
,#+MACRO: SEC_FOO=C2=A0
lines out of the code block.=C2=A0 If I didn=E2=80=99t= and tried to eval that block, I got the error

=C2= =A0 =C2=A0No org-babel-execute function for org!

You just need to add org as an org babel language:
<= div>
=C2=A0 (let (ob-lang-alist)
=C2=A0 =C2=A0 (add= -to-list 'ob-lang-alist '(org . t))
=C2=A0 =C2=A0 (org-ba= bel-do-load-languages 'org-babel-load-languages ob-lang-alist))=C2=A0

You don't necessarily need the let form above, = but that is in a form that allows easily adding more languages in future.
--

Kaushal Modi

--001a11488d16fdaecf055cf0529f--