emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: John Hendy <jw.hendy@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Automatic noexport tag based on rules?
Date: Fri, 11 Feb 2011 09:34:26 +0100	[thread overview]
Message-ID: <B436915C-A12D-4FD0-A1BA-09C50630D46A@gmail.com> (raw)
In-Reply-To: <AANLkTimJK63-O7sAOpjVwKcUMaL1hMbtvpZJUq90m+xi@mail.gmail.com>


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

> Hi,
>
>
> My apologies if this has been discussed. I couldn't find it. I write  
> everything from work in org-mode for several reasons. Primarily,  
> it's my documentation system for research in order to properly  
> document Intellectual Property (IP) information. It's also for todos  
> and contacts. When it comes to exporting my notes into PDF for use  
> in an IP notebook... I dont' want my todos in there.
>
> Is there a way to automatically tag TODOs with :noexport:?


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.  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.

Nick, an easy way to set a particular tag is

(org-toggle-tag "noexport" 'on)

The line number stuff  in org-change-tag-in-region is there
to allow people to have point in the line *after* the last
headline to change.  But maybe you can fix this by making
a special case for point and mark in the same line...

- 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

  parent reply	other threads:[~2011-02-11  8:34 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-09  0:29 Automatic noexport tag based on rules? John Hendy
2011-02-09  1:58 ` Jeff Horn
2011-02-09  2:39   ` John Hendy
2011-02-09  2:53     ` Jeff Horn
2011-02-09  7:40     ` Eric S Fraga
2011-02-09 15:18       ` John Hendy
2011-02-09 16:58         ` John Hendy
2011-02-09 18:13       ` Nicolas Goaziou
2011-02-09 18:46         ` John Hendy
2011-02-09  9:36     ` Automatic noexport tag based on rules? (and a possible bug) Nick Dokos
2011-02-11  8:34 ` Carsten Dominik [this message]
2011-02-11 15:33   ` Automatic noexport tag based on rules? John Hendy
2011-02-25 22:37 ` John Hendy
2011-03-27 19:37   ` [Orgmode] " Samuel Wales
2011-03-27 20:10     ` John Hendy
2011-03-29 18:40       ` Matt Lundin
2011-03-29 21:05         ` Carsten Dominik
2011-03-29 21:15           ` Carsten Dominik
2011-03-29 21:48             ` John Hendy
2011-03-29 22:49               ` Carsten Dominik
2011-03-29 22:50                 ` John Hendy
2011-03-30  3:30                   ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B436915C-A12D-4FD0-A1BA-09C50630D46A@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=jw.hendy@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).