From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: #+INCLUDE: file in code block results does not work? Date: Wed, 26 Mar 2014 10:35:14 +0100 Message-ID: <87wqfhuwtp.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSkEU-0001e3-HA for emacs-orgmode@gnu.org; Wed, 26 Mar 2014 05:34:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WSkEQ-0004i6-3B for emacs-orgmode@gnu.org; Wed, 26 Mar 2014 05:34:50 -0400 Received: from mail-wg0-x232.google.com ([2a00:1450:400c:c00::232]:58101) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSkEP-0004ht-S8 for emacs-orgmode@gnu.org; Wed, 26 Mar 2014 05:34:46 -0400 Received: by mail-wg0-f50.google.com with SMTP id x13so1088806wgg.21 for ; Wed, 26 Mar 2014 02:34:44 -0700 (PDT) In-Reply-To: (KDr2's message of "Wed, 26 Mar 2014 15:48:59 +0800") 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: KDr2 Cc: emacs-orgmode@gnu.org Hello, KDr2 writes: > I wrote a piece of code like below: > > #+NAME: inc-file > #+BEGIN_SRC elisp :results value raw :exports results :var file=" > common.inc.org" > (concat "#+INCLUDE: /path/to/include-dir/" file) ;; path is cal-ed from > path of current-buffer file > #+END_SRC > > #+CALL: inc-file(file="a.org") :results raw > > but this does not work, anyone knows why? During export process, INCLUDE keywords are expanded before Babel code is executed. You can use a macro here: #+MACRO: inc-file #+INCLUDE: /path/to-include-dir/$1 {{{inc-file(a.org)}}} Regards, -- Nicolas Goaziou