From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Using org-map-entries with org-export-before-processing-hook Date: Wed, 06 Mar 2013 14:29:19 +0100 Message-ID: <87ip54zmfk.fsf@gmail.com> References: <871ubt8awv.fsf@ericabrahamsen.net> <87boaw25us.fsf@gmail.com> <876214g6tp.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:59952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDEPZ-0004YE-0q for emacs-orgmode@gnu.org; Wed, 06 Mar 2013 08:29:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDEPT-000156-N6 for emacs-orgmode@gnu.org; Wed, 06 Mar 2013 08:29:36 -0500 Received: from mail-wg0-f53.google.com ([74.125.82.53]:40630) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDEPT-000150-GL for emacs-orgmode@gnu.org; Wed, 06 Mar 2013 08:29:31 -0500 Received: by mail-wg0-f53.google.com with SMTP id fn15so7336544wgb.8 for ; Wed, 06 Mar 2013 05:29:30 -0800 (PST) In-Reply-To: <876214g6tp.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Wed, 06 Mar 2013 18:29:06 +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: Eric Abrahamsen Cc: emacs-orgmode@gnu.org Eric Abrahamsen writes: >> The problem is not directly related to the export framework, but to its >> relationship with `org-map-entries'. >> >> If you use the following function: >> >> (defun before-export-test (backend) >> ;; (org-map-entries 'test-map "TODO=\"TODO\"" 'file) >> (while (re-search-forward "^\\*+ TODO" nil t) >> (test-map))) >> >> it should work. >> >> I don't know why `org-map-entries' behaves badly with export. Meanwhile, >> I suggest to not use this function for export hooks. > > That'll work! Thanks for looking at this. I think I fixed the problem wrt `org-map-entries' and export. You cannot use `file' scope, since it refers to the base buffer associated to the current buffer file name, which never is the buffer where the export process takes place. OTHO, a nil scope (or tree, region for that matter) should be fine with a very recent Org. Regards, -- Nicolas Goaziou