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 15:31:11 +0100 Message-ID: <878urxuj4g.fsf@gmail.com> References: <87wqfhuwtp.fsf@gmail.com> <87siq5uwic.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56547) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSoqx-0001K3-7m for emacs-orgmode@gnu.org; Wed, 26 Mar 2014 10:30:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WSoqp-0002Nb-Vm for emacs-orgmode@gnu.org; Wed, 26 Mar 2014 10:30:51 -0400 Received: from mail-we0-x233.google.com ([2a00:1450:400c:c03::233]:35628) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSoqp-0002NQ-7j for emacs-orgmode@gnu.org; Wed, 26 Mar 2014 10:30:43 -0400 Received: by mail-we0-f179.google.com with SMTP id x48so1165369wes.24 for ; Wed, 26 Mar 2014 07:30:42 -0700 (PDT) In-Reply-To: (KDr2's message of "Wed, 26 Mar 2014 22:04:44 +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 blog entry to describe all the dynamic tricks I used in the > exporting: > > http://kdr2.com/tech/emacs/orgmode-export-process.html Thank you for sharing. For completeness, there is another step involved in the process before switching to back-ends: run functions in `org-export-before-parsing-hook'. >> I use dynamic block now, by adding `org-update-all-dblocks' to >> `org-export-before-processing-hook'. Also, you can also a function in the same hook that would update a generic "inc-file" macro in the file: (lambda (backend) (org-with-wide-buffer (goto-char (point-min)) (let ((case-fold-search nil)) (while (re-search-forward "^ *#\\+MACRO: +inc-file +\"\\(PATH\\)" nil t) (replace-match (get-path-dynamically) t nil nil 1))))) with the following generic macro: #+MACRO: inc-file "PATH$1" Regards, -- Nicolas Goaziou