From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Automatic noexport tag based on rules? Date: Fri, 11 Feb 2011 09:34:26 +0100 Message-ID: References: Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=37362 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PnoSW-0007ye-2a for emacs-orgmode@gnu.org; Fri, 11 Feb 2011 03:34:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PnoSU-0001EP-7l for emacs-orgmode@gnu.org; Fri, 11 Feb 2011 03:34:31 -0500 Received: from mail-wy0-f169.google.com ([74.125.82.169]:33749) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PnoSU-0001EL-23 for emacs-orgmode@gnu.org; Fri, 11 Feb 2011 03:34:30 -0500 Received: by wyj26 with SMTP id 26so2310589wyj.0 for ; Fri, 11 Feb 2011 00:34:29 -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: John Hendy Cc: emacs-orgmode 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