From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Hook request and patch Date: Wed, 31 Dec 2008 09:45:35 +0100 Message-ID: <45C5E5C5-76B5-40C8-B836-07E1E80C704F@uva.nl> References: <5483.66.30.178.137.1230610952.squirrel@mail.panix.com> Mime-Version: 1.0 (Apple Message framework v929.2) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LHwhw-0000pW-V5 for emacs-orgmode@gnu.org; Wed, 31 Dec 2008 03:45:40 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LHwhw-0000pB-BX for emacs-orgmode@gnu.org; Wed, 31 Dec 2008 03:45:40 -0500 Received: from [199.232.76.173] (port=52394 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LHwhw-0000p6-45 for emacs-orgmode@gnu.org; Wed, 31 Dec 2008 03:45:40 -0500 Received: from mail-ew0-f13.google.com ([209.85.219.13]:54305) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LHwhv-0006t0-LB for emacs-orgmode@gnu.org; Wed, 31 Dec 2008 03:45:39 -0500 Received: by ewy6 with SMTP id 6so6196443ewy.18 for ; Wed, 31 Dec 2008 00:45:37 -0800 (PST) In-Reply-To: <5483.66.30.178.137.1230610952.squirrel@mail.panix.com> 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: "Tom Breton (Tehom)" Cc: emacs-orgmode@gnu.org Hi Tom, is there a reason why you did not put the hook right after the include file moment? - Carsten On Dec 30, 2008, at 5:22 AM, Tom Breton (Tehom) wrote: > Motivating incident: I was exporting some files and I wanted to > process a file after I included it. Using "#+INCLUDE" I could include > it and I could tell it to use "BEGIN_XXX" "END_XXX" so my code could > find it. > > But I couldn't process it, because org-export-preprocess-string calls > `org-export-preprocess-hook' before it handles "#+INCLUDE". > > I didn't want to move org-export-preprocess-hook because for all I > know there's a good reason it comes first. Similarly for the timing > of "#+INCLUDE". > > So I ask for a hook that is called after includes are handled. Diffs > appended. > > Another advantage: `org-update-all-dblocks' didn't seem to work in > org-export-preprocess-hook because the working buffer isn't yet in > org-mode when it's called, but works in the new hook. > > Tom Breton (Tehom) > > *** old-org-exp.el 2008-12-18 18:26:05.000000000 -0500 > --- org-exp.el 2008-12-29 23:10:46.000000000 -0500 > *************** > *** 297,302 **** > --- 297,305 ---- > (defvar org-export-preprocess-hook nil > "Hook for preprocessing an export buffer. > Pretty much the first thing when exporting is running this hook.") > + (defvar org-export-midprocess-hook nil > + "Hook for processing an export buffer after file inclusions. > + Run after file inclusions and tree exclusions.") > > (defgroup org-export-translation nil > "Options for translating special ascii sequences for the export > backends." > *************** > *** 1522,1527 **** > --- 1525,1532 ---- > ;; Find matches for radio targets and turn them into internal > links > (org-export-mark-radio-links) > > + (run-hooks 'org-export-midprocess-hook) > + > ;; Find all links that contain a newline and put them into a > single line > (org-export-concatenate-multiline-links) > > > > > > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode