Oh, I'll star this mail, and add it to my post later, thanks again :)


On Wed, Mar 26, 2014 at 10:31 PM, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
Hello,

KDr2 <killy.draw@gmail.com> 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



--
-- 

KDr2, http://kdr2.com