From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Using org-map-entries with org-export-before-processing-hook Date: Wed, 06 Mar 2013 11:28:00 +0800 Message-ID: <871ubt8awv.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:48652) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UD4wB-0007QW-Oh for emacs-orgmode@gnu.org; Tue, 05 Mar 2013 22:22:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UD4wA-0002MN-Tt for emacs-orgmode@gnu.org; Tue, 05 Mar 2013 22:22:39 -0500 Received: from plane.gmane.org ([80.91.229.3]:58339) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UD4wA-0002MJ-Mp for emacs-orgmode@gnu.org; Tue, 05 Mar 2013 22:22:38 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UD4wT-0004Ds-PN for emacs-orgmode@gnu.org; Wed, 06 Mar 2013 04:22:57 +0100 Received: from 114.250.135.195 ([114.250.135.195]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 06 Mar 2013 04:22:57 +0100 Received: from eric by 114.250.135.195 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 06 Mar 2013 04:22:57 +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 --=-=-= Content-Type: text/plain I've attached a minimum org file that shows what I'm trying to do: essentially to attach a hook to the export process that ends up calling org-map-entries to make alterations to the file just before it's exported. As I've got it now, the hook does change the org buffer, but those changes are *not* reflected in the exported output. I can only guess that somehow the export process is able to continue on before the org-map-entries results are returned? Doesn't seem likely, but... This is actually kind of the opposite of what I'd like: to have the changes *only* reflected in the export, and leave the original buffer unchanged. On the other hand, I can see what thought and care has gone into setting up a clone buffer for export (and I do need to rely on buffer-local variables), so maybe an (undo) is my best solution for returning the buffer to its pre-export state. But I would like the changes to show up in the exported file! Thanks in advance, Eric --=-=-= Content-Type: application/vnd.lotus-organizer Content-Disposition: inline; filename=test2.org Content-Transfer-Encoding: base64 KiBUZXN0IEhlYWRpbmcKVGV4dCBvZiB0aGUgdGVzdCBib2R5LgogCiogQ29kZSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6bm9leHBv cnQ6CgojK0JFR0lOX1NSQyBlbWFjcy1saXNwCiAgKGRlZnVuIHRlc3QtbWFwICgpCiAgICAobGV0 ICgoZW5kIChvcmctZWxlbWVudC1wcm9wZXJ0eSA6ZW5kIChvcmctZWxlbWVudC1hdC1wb2ludCkp KSkKICAgICAgKHdoaWxlIChyZS1zZWFyY2gtZm9yd2FyZCAiXFwodGVzdCBib2R5XFwpIiBlbmQg dCkKICAgICAgICAocmVwbGFjZS1tYXRjaCAidGVzdCBiYXdkeSIpKSkpCiAgCiAgKGRlZnVuIGJl Zm9yZS1leHBvcnQtdGVzdCAoYmFja2VuZCkKICAgIChvcmctbWFwLWVudHJpZXMgJ3Rlc3QtbWFw ICItbm9leHBvcnQiICdmaWxlKSkKICAKICAoYWRkLWhvb2sgJ29yZy1leHBvcnQtYmVmb3JlLXBy b2Nlc3NpbmctaG9vawogICAgICAgICAgICAnYmVmb3JlLWV4cG9ydC10ZXN0IHQpCiAgKG9yZy1o dG1sLWV4cG9ydC10by1odG1sKQogIChyZW1vdmUtaG9vayAnb3JnLWV4cG9ydC1iZWZvcmUtcHJv Y2Vzc2luZy1ob29rCiAgICAgICAgICAgICAgICdiZWZvcmUtZXhwb3J0LXRlc3QgdCkKIytFTkRf U1JDCgojK1JFU1VMVFM6Cgo= --=-=-=--