From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Ond=C5=99ej_Grover?= Subject: [PATCH]Extend export hook example for removing headlines with tag ignore_heading Date: Sun, 12 Apr 2015 13:59:00 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=089e0115ef401b45b3051385b90e Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51356) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhGXY-0005X5-Ay for emacs-orgmode@gnu.org; Sun, 12 Apr 2015 07:59:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YhGXW-0005zE-H3 for emacs-orgmode@gnu.org; Sun, 12 Apr 2015 07:59:04 -0400 Received: from mail-qk0-x235.google.com ([2607:f8b0:400d:c09::235]:33414) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhGXW-0005wL-BJ for emacs-orgmode@gnu.org; Sun, 12 Apr 2015 07:59:02 -0400 Received: by qkx62 with SMTP id 62so123303547qkx.0 for ; Sun, 12 Apr 2015 04:59:00 -0700 (PDT) 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 --089e0115ef401b45b3051385b90e Content-Type: multipart/alternative; boundary=089e0115ef401b45ac051385b90c --089e0115ef401b45ac051385b90c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello, I've attached a patch for the Advanced configuration (for exporting) chapter of the Org mode manual that extends the hook example there to provide the commonly requested ignoreheading-like functionality found in the Beamer backend. The example is very simple and adds just one line of code to the function thanks to the MATCH argument of the `org-map-entries` function. The commit message contains the TINYCOMMIT cookie as I'm not a FSF member. Originally I only intended this solution to be an answer to questions on StackOverflow that did not help me much ( http://stackoverflow.com/a/29588450/4779220), but I think it is something very commonly requested and should be documented and easily accessible. How I discovered this solution: I've always liked the `ignoreheading` tag functionality in Beamer export. I wanted to have something like it for all export backends. The solutions I found on the Internet either didn't work or were filter based which did not remove the headline nodes in the parsed structure. So I decided to make my own solution. I found the hook example for removing all headlines before processing in the Org manual. That was almost what I wanted, but I needed to limit it to headlines with a tag. I had a look at the documentation of the `org-map-entries` function and discovered the MATCH argument that can match tags like in agenda views. So in the end I added just 1 line of code to the example. This experience once again showed me that Emacs truly is an extensible self-documenting editor. I'd like to express my gratitude to all the contributors of Emacs and Org mode. Kind regards, Ond=C5=99ej Grover --089e0115ef401b45ac051385b90c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hello,

I've= attached a patch for the Advanced configuration (for exporting) chapter of= the Org mode manual that extends the hook example there to provide the com= monly requested ignoreheading-like functionality found in the Beamer backen= d. The example is very simple and adds just one line of code to the functio= n thanks to the MATCH argument of the `org-map-entries` function.
=
The commit message contains the TINYCOMMIT cookie as I'm not a FSF= member.

Originally I only intended this solut= ion to be an answer to questions on StackOverflow that did not help me much= (http://stackoverf= low.com/a/29588450/4779220), but I think it is something very commonly = requested and should be documented and easily accessible.
How I discovered this solution:
I've always liked = the `ignoreheading` tag functionality in Beamer export. I wanted to have so= mething like it for all export backends.
The solutions I found on = the Internet either didn't work or were filter based which did not remo= ve the headline nodes in the parsed structure.
So I decided to mak= e my own solution. I found the hook example for removing all headlines befo= re processing in the Org manual. That was almost what I wanted, but I neede= d to limit it to headlines with a tag. I had a look at the documentation of= the `org-map-entries` function and discovered the MATCH argument that can = match tags like in agenda views. So in the end I added just 1 line of code = to the example.

This experience once again showed me that Emacs trul= y is an extensible self-documenting editor. I'd like to express my grat= itude to all the contributors of Emacs and Org mode.

Kind regards,
Ond=C5=99ej Grover
--089e0115ef401b45ac051385b90c-- --089e0115ef401b45b3051385b90e Content-Type: text/x-diff; charset=US-ASCII; name="0001-org.texi-Extend-export-hook-example-with-ignore_head.patch" Content-Disposition: attachment; filename="0001-org.texi-Extend-export-hook-example-with-ignore_head.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_i8eedhtd0 RnJvbSAxZTE5ZTUxNzRlMjFlOGRkZmQ5NmVkNWRhNWMyY2JiYjQ0NGU5ZDE2IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBPbmRyZWogR3JvdmVyIDxvbmRyZWouZ3JvdmVyQGdtYWlsLmNv bT4KRGF0ZTogU3VuLCAxMiBBcHIgMjAxNSAxMzo0MzozMSArMDIwMApTdWJqZWN0OiBbUEFUQ0hd IG9yZy50ZXhpOiBFeHRlbmQgZXhwb3J0IGhvb2sgZXhhbXBsZSB3aXRoIGlnbm9yZV9oZWFkaW5n IHRhZwogc3VwcG9ydAoKKiBkb2Mvb3JnLnRleGkgKEFkdmFuY2VkIGNvbmZpZ3VyYXRpb24pOiBF eHRlbmQgdGhlIHByZS1wcm9jZXNzaW5nCmV4cG9ydCBob29rIGV4YW1wbGUgdG8gc3VwcG9ydCBz aW1pbGFyIChidXQgc2ltcGxlciBhbmQgbW9yZSBnZW5lcmFsKQpmdW5jdGlvbmFsaXR5IGxpa2Ug dGhhdCBwcm92aWRlZCBieSB0aGUgaWdub3JlaGVhZGluZyB0YWcgaW4gdGhlCkJlYW1lciBleHBv cnQgYmFja2VuZC4gIFRoaXMgaXMgYSBjb21tb25seSByZXF1ZXN0ZWQgc25pcHBldCBhbmQgdGhl CkludGVybmV0IGlzIGZ1bGwgb2YgbXVjaCB3b3JzZSBhbmQgYnJva2VuIHNvbHV0aW9ucywgc28g dGhlIG1hbnVhbApzaG91bGQgc2hvdyB0aGUgcmVjb21tZW5kZWQgc29sdXRpb24uCgpUSU5ZQ0hB TkdFCi0tLQogZG9jL29yZy50ZXhpIHwgMjMgKysrKysrKysrKysrKystLS0tLS0tLS0KIDEgZmls ZSBjaGFuZ2VkLCAxNCBpbnNlcnRpb25zKCspLCA5IGRlbGV0aW9ucygtKQ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