From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Clemente Subject: Re: Export without TODO keywords Date: Thu, 25 Dec 2008 23:34:48 +0100 Message-ID: <874p0rhojb.fsf@gmail.com> References: <873ah88xfr.fsf@gmail.com> <878wr06ljc.fsf@kassiopeya.MSHEIMNETZ> <9DC4A09B-9A92-4584-A6DB-2A548987D27F@uva.nl> <87oczr7e6j.fsf@gmail.com> <8CAA59A3-A572-4674-B0C2-D31C59DA9181@uva.nl> <87skp2mya7.fsf@CPU107.opentrends.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LFynA-0005CT-GR for emacs-orgmode@gnu.org; Thu, 25 Dec 2008 17:34:56 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LFyn8-0005CH-HK for emacs-orgmode@gnu.org; Thu, 25 Dec 2008 17:34:55 -0500 Received: from [199.232.76.173] (port=53545 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LFyn8-0005CE-8I for emacs-orgmode@gnu.org; Thu, 25 Dec 2008 17:34:54 -0500 Received: from mail-ew0-f13.google.com ([209.85.219.13]:34134) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LFyn7-0002NW-Pf for emacs-orgmode@gnu.org; Thu, 25 Dec 2008 17:34:54 -0500 Received: by ewy6 with SMTP id 6so4014937ewy.18 for ; Thu, 25 Dec 2008 14:34:51 -0800 (PST) In-Reply-To: (Carsten Dominik's message of "Sat, 6 Dec 2008 08:38:42 +0100") 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: Carsten Dominik Cc: emacs-orgmode@gnu.org Hi, > Carsten Dominik writes: >> >> .... >> Then only =E2=80=9Elog notes=E2=80=9C exporting is not configurable. > > True, but this is not really metadata, but notes, which could > easily be confused with normal plain text. > > I think I will stop here adding options for this purpose. > > You can try to write a small function which removes these > as well, and call it from `org-export-preprocess-hook'. > By the way, this is how I finally removed all tracking information under = the headlines. I included it in my file and had to eval it so that it registers the hook. You can use the code as you like. -- Daniel (defun org-export-remove-notes-from-all-headings () "Removes all the tracking information of headings, like log notes, keywor= ds, and clocking. Add this as a hook to `org-export-preprocess-hook'" (show-all) (org-map-entries 'org-export-remove-notes-from-heading nil nil) ) (defun org-export-remove-notes-from-heading () "Removes all the tracking information which is under the current headline= , if it contains. This information includes log notes (see `org-log-done'), CLOSED/SCHEDULED/= DEADLINE keywords, CLOCK entries and others." (unless (org-at-heading-p) (error "Not on a headline")) (beginning-of-line) (let* ( (level (org-reduced-level (funcall outline-level))) ; Regexp of lines to delete. If it starts with TAB, it is indented and thu= s we delete it. If it has spaces, we delete if the number of spaces is equa= l to the heading level (number of *) (regexp-of-deletable (concat "^\\(\t+\\|" (make-string level ? ) "\\)")) ) (forward-line) (while (looking-at regexp-of-deletable) ;(message (concat "Deleting this text: " (buffer-substring (line-beginn= ing-position) (line-end-position)))) (kill-line t) ) ) ) (add-hook 'org-export-preprocess-hook 'org-export-remove-notes-from-all-hea= dings)