From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Name of file being exported. Date: Tue, 14 Apr 2009 14:26:50 -0400 Message-ID: <17069.1239733610@gamaville.dokosmarshall.org> References: <49E3F37E.5090704@nibrahim.net.in> <5DBFB303-366D-4485-82B9-6CF0EFAC257C@gmail.com> <49E4A4A4.8050909@nibrahim.net.in> <16352.1239726014@gamaville.dokosmarshall.org> <49E4BC54.1060504@nibrahim.net.in> Reply-To: nicholas.dokos@hp.com Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LtnMo-0001zc-FM for emacs-orgmode@gnu.org; Tue, 14 Apr 2009 14:28:18 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LtnMn-0001yp-0S for emacs-orgmode@gnu.org; Tue, 14 Apr 2009 14:28:18 -0400 Received: from [199.232.76.173] (port=56105 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LtnMm-0001ym-SD for emacs-orgmode@gnu.org; Tue, 14 Apr 2009 14:28:16 -0400 Received: from qmta06.emeryville.ca.mail.comcast.net ([76.96.30.56]:39861) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LtnMm-0005BL-FX for emacs-orgmode@gnu.org; Tue, 14 Apr 2009 14:28:16 -0400 In-Reply-To: Message from Noufal Ibrahim of "Tue, 14 Apr 2009 22:09:48 +0530." <49E4BC54.1060504@nibrahim.net.in> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Noufal Ibrahim Cc: emacs-orgmode@gnu.org Noufal Ibrahim 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 > pages. > > 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. HTH, Nick