From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: Using org-map-entries with org-export-before-processing-hook Date: Thu, 07 Mar 2013 08:44:30 +0800 Message-ID: <87zjygca35.fsf@ericabrahamsen.net> References: <871ubt8awv.fsf@ericabrahamsen.net> <87boaw25us.fsf@gmail.com> <876214g6tp.fsf@ericabrahamsen.net> <87ip54zmfk.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:59170) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDOrW-0003oD-Vd for emacs-orgmode@gnu.org; Wed, 06 Mar 2013 19:39:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDOrW-0001xz-0O for emacs-orgmode@gnu.org; Wed, 06 Mar 2013 19:39:10 -0500 Received: from plane.gmane.org ([80.91.229.3]:38498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDOrV-0001xv-Po for emacs-orgmode@gnu.org; Wed, 06 Mar 2013 19:39:09 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UDOrp-00084H-Rn for emacs-orgmode@gnu.org; Thu, 07 Mar 2013 01:39:29 +0100 Received: from 114.250.116.160 ([114.250.116.160]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 07 Mar 2013 01:39:29 +0100 Received: from eric by 114.250.116.160 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 07 Mar 2013 01:39:29 +0100 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: emacs-orgmode@gnu.org Nicolas Goaziou writes: > 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. Whoa, not only does it work, it leaves the original buffer unmodified, as per my wishlist. Many thanks! I don't know when you find the time to sleep. E