From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hendy Subject: Re: Automatic noexport tag based on rules? Date: Fri, 11 Feb 2011 09:33:25 -0600 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1299964675==" Return-path: Received: from [140.186.70.92] (port=53016 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pnuzx-0000yT-PJ for emacs-orgmode@gnu.org; Fri, 11 Feb 2011 10:33:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pnuzv-00083f-Pa for emacs-orgmode@gnu.org; Fri, 11 Feb 2011 10:33:29 -0500 Received: from mail-bw0-f41.google.com ([209.85.214.41]:33855) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pnuzv-00083R-Am for emacs-orgmode@gnu.org; Fri, 11 Feb 2011 10:33:27 -0500 Received: by bwz16 with SMTP id 16so3290385bwz.0 for ; Fri, 11 Feb 2011 07:33:25 -0800 (PST) In-Reply-To: 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 --===============1299964675== Content-Type: multipart/alternative; boundary=001636c5a842497eda049c036b9f --001636c5a842497eda049c036b9f Content-Type: text/plain; charset=ISO-8859-1 On Fri, Feb 11, 2011 at 2:34 AM, Carsten Dominik wrote: > > On Feb 9, 2011, at 1:29 AM, John Hendy wrote: > > An alternative to using the :noexport: tag, and also to > the other suggestions given here in this thread would > be to use `org-map-entries' to physically remove all > subtrees which match your condition. And this physically removes the TODOs from the "blob" being exported, not from my .org files, right? If so, perhaps that would be an option. Strip it from the stream headed for export. Thanks for giving the code. John > You can call the > mapper from one of the preprocessing hooks: > > (defun my-export-remove-TODO () > (org-map-entries > ;; The following form will be evaluated at each matching tree > '(progn > (outline-mark-subtree) ; mark tree > (delete-region (point) (mark))) ; remove it > ;; Now the tags/property/todo matcher to select trees > "LEVEL<15+TODO={.}" > )) > > ;; Call this after other tree selection has been processed > (add-hook 'org-export-preprocess-after-tree-selection-hook > 'my-export-remove-TODO) > > The matcher includes a LEVEL<15 test to make sure this will > not mess with inline tasks. > > Export preprocessor hooks are a good place for such tasks. > Also Nick's proposal could be used in such a hook, but not > the same hook as I have used above. Maybe in > org-export-preprocessor-after-include-files-hook. > > > - Carsten > > > > > > >> Or simply add the TODO category to the noexport category altogether? >> >> I haven't turned up anything quite along these lines. One post suggested >> using "TODO keyword COMMENT" [1], but that just seems to perhaps exclude >> from export (didn't try) but I know for sure it removes it from agenda view. >> I want TODOs in agenda but don't want them showing up with my LaTeX export. >> I typically print out my work to-date each month or so and have to comb >> through my org file for that month, manually adding :noexport: to my TODOs. >> Even if I still do this for a few things here and there... it will save me a >> lot of time. >> >> I suppose I could keep a separate "TODO.org" file, but I really like the >> process of being able to add them anywhere -- it seems more natural to do >> that in the flow, particularly in meetings, than to constantly switch >> buffers or even use remember to keep sending things related to the current >> topic away to their own island. >> >> I'm 80% confident that the answer is ridiculously simply and I just >> haven't searched the right thing. Thanks for enlightening me! >> >> >> Thanks, >> John >> _______________________________________________ >> Emacs-orgmode mailing list >> Please use `Reply All' to send replies to the list. >> Emacs-orgmode@gnu.org >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode >> > > --001636c5a842497eda049c036b9f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Fri, Feb 11, 2011 at 2:34 AM, Carsten Dom= inik <car= sten.dominik@gmail.com> wrote:

On Feb 9, 2011, at 1:29 AM, John Hendy wrote:

An alternative to using the :noexport: tag, and also to
the other suggestions given here in this thread would
be to use `org-map-entries' to physically remove all
subtrees which match your condition.

And th= is physically removes the TODOs from the "blob" being exported, n= ot from my .org files, right? If so, perhaps that would be an option. Strip= it from the stream headed for export.

Thanks for giving the code.

John
=A0
You ca= n call the
mapper from one of the preprocessing hooks:

(defun my-export-remove-TODO ()
=A0(org-map-entries
=A0;; The following form will be evaluated at each matching tree
=A0'(progn
=A0 =A0 (outline-mark-subtree) =A0 =A0 =A0 =A0 =A0; mark tree
=A0 =A0 (delete-region (point) (mark))) ; remove it
=A0;; Now the tags/property/todo matcher to select trees
=A0"LEVEL<15+TODO=3D{.}"
=A0))

;; Call this after other tree selection has been processed
(add-hook 'org-export-preprocess-after-tree-selection-hook
=A0 =A0 =A0 =A0 =A0'my-export-remove-TODO)

The matcher includes a LEVEL<15 test to make sure this will
not mess with inline tasks.

Export preprocessor hooks are a good place for such tasks.
Also Nick's proposal could be used in such a hook, but not
the same hook as I have used above. =A0Maybe in
org-export-preprocessor-after-include-files-hook.


- Carsten






Or simply add the TODO category to the noexport category altogether?

I haven't turned up anything quite along these lines. One post suggeste= d using "TODO keyword COMMENT" [1], but that just seems to perhap= s exclude from export (didn't try) but I know for sure it removes it fr= om agenda view. I want TODOs in agenda but don't want them showing up w= ith my LaTeX export. I typically print out my work to-date each month or so= and have to comb through my org file for that month, manually adding :noex= port: to my TODOs. Even if I still do this for a few things here and there.= .. it will save me a lot of time.

I suppose I could keep a separate "TODO.org" file, but I really l= ike the process of being able to add them anywhere -- it seems more natural= to do that in the flow, particularly in meetings, than to constantly switc= h buffers or even use remember to keep sending things related to the curren= t topic away to their own island.

I'm 80% confident that the answer is ridiculously simply and I just hav= en't searched the right thing. Thanks for enlightening me!


Thanks,
John
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gn= u.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


--001636c5a842497eda049c036b9f-- --===============1299964675== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1299964675==--