From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Re: "clearing" the state of an org-mode subtree Date: Mon, 12 Oct 2009 14:46:44 +0200 Message-ID: <9A49E5D9-DBBE-4C98-9B41-2D91180FCC40@gmail.com> References: <4ACFAB1B.7010604@sift.info> <1f38ae890910091643r611e0cadlbe52727c30d6b9f6@mail.gmail.com> <4AD0C8CF.5080106@sift.info> <877hv24607.fsf@gmail.com> <87fx9qw1j8.fsf@gollum.intra.norang.ca> <10122.1255299688@gamaville.dokosmarshall.org> <4AD32385.4070709@sift.info> 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 mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MxKIf-00058w-Fx for emacs-orgmode@gnu.org; Mon, 12 Oct 2009 08:46:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MxKIb-00053V-2d for emacs-orgmode@gnu.org; Mon, 12 Oct 2009 08:46:53 -0400 Received: from [199.232.76.173] (port=45268 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MxKIa-00053P-R4 for emacs-orgmode@gnu.org; Mon, 12 Oct 2009 08:46:48 -0400 Received: from mail-ew0-f228.google.com ([209.85.219.228]:41987) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MxKIa-0006XC-5Y for emacs-orgmode@gnu.org; Mon, 12 Oct 2009 08:46:48 -0400 Received: by ewy28 with SMTP id 28so16070952ewy.42 for ; Mon, 12 Oct 2009 05:46:47 -0700 (PDT) In-Reply-To: <4AD32385.4070709@sift.info> 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: Robert Goldman Cc: emacs-orgmode@gnu.org On Oct 12, 2009, at 2:39 PM, Robert Goldman wrote: > Nick Dokos wrote: >> Robert P. Goldman wrote: >> >> ... >>>>> Robert Goldman sift.info> writes: >>>>> >>>>>> Andrew Stribblehill wrote: >>>>>>> org-mode files are plain text. M-% to do a replacement: once >>>>>>> you've >>>>>>> entered your search term and its replacement, hit ! to replace >>>>>>> all >>>>>>> without question. >>>>>> Yes, one can do this, but note that it's not entirely a no- >>>>>> brainer. You >>>>>> need to: >>>>>> >>>>>> 1. clear all the check boxes and then recompute all checkbox >>>>>> counts in >>>>>> the region. [this isn't a simple tag replacement] >>>>>> >>>>>> 2. replace all non-TODO keywords with TODO. This is a >>>>>> replacement, but >>>>>> not a simple one to do with M-% >>>>>> >>>>>> 3. Wipe out all of the notes that were added with state changes. >>>>>> Again, this can be done with a replacement command, but it's >>>>>> not a >>>>>> trivial one. >>>>>> >>>>>> This is one of those cases where automating a task will not pay >>>>>> back the >>>>>> investment (at least not to me, individually), so I think I'd >>>>>> better >>>>>> just do it by hand. >>>>>> >> ... >> >> Apologies for jumping in without the whole context (I'm buried with >> work >> and I have not been able to even read the whole thread). I'm not sure >> how to do #1 and #3 above, but I believe that #2 can be done with the >> mapping API (see section A.10 of the org manual) - something like >> this >> (untested and too simple as it stands - probably won't handle >> headlines >> without a todo keyword correctly): >> >> (org-map-entries (lambda () (org-todo "TODO")) t 'tree) >> >> but it may be worth a try. It may even be possible to extend it to do >> the other stuff. > > Thanks, that's very helpful. That is indeed what I'm looking for > --- I > had been thinking in terms of string replacement, but this reminds me > that there are functions that address org trees semantically, based on > the meaning of the entries. > > In addition to org-todo, there's also org-reset-checkbox-state- > subtree. > I haven't yet found anything that will find an org-note (so that it > can > be removed), but I will look more carefully. You should be logging into a drawer - drawer are much easier to find than individual notes. - Carsten