[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Name of file being exported.

From: Carsten Dominik
Subject: Re: [Orgmode] Name of file being exported.
Date: Wed, 15 Apr 2009 07:02:39 +0200

On Apr 14, 2009, at 8:26 PM, Nick Dokos wrote:

Noufal Ibrahim <address@hidden> wrote:

Hi Nick,

Nick Dokos wrote:

Can you run org-update-all-dblocks by hand before doing the export?

That's possible. What I do now is to to add the
org-update-all-dbblocks to write-file-hooks as suggested by the info

This works for me but there are times when I export directly without
saving and I'd like the block to get updated then too.

If so, you can even automate the process by advising
org-export, so that org-update-all-dblocks is run before org-export
proper is called. [1]

This sounds better. I shall try this. Although I'm wondering if there
isn't a hook that I can add a function to manage what I want.

Maybe this will work: the current buffer-file-name is saved in
org-export-as-html (and I assume in the other export routines) in a
dynamically scoped variable called org-current-export-file. The value of
that variable should be available in the hook as well. So instead of
(buffer-file-name), you probably want to say

       (or (buffer-file-name) org-current-export-file)

That way, your updater can be called both from inside and outside
the export functions.

Great solution.

We could also introduce a new hook which is run before export.  However,
for the functionality discussed here, I think that before-save-hook would
be a very good place too.

- Carsten


reply via email to

[Prev in Thread] Current Thread [Next in Thread]