From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Re: "clearing" the state of an org-mode subtree Date: Sun, 11 Oct 2009 18:21:28 -0400 Message-ID: <10122.1255299688@gamaville.dokosmarshall.org> References: <4ACFAB1B.7010604@sift.info> <1f38ae890910091643r611e0cadlbe52727c30d6b9f6@mail.gmail.com> <4AD0C8CF.5080106@sift.info> <877hv24607.fsf@gmail.com> <87fx9qw1j8.fsf@gollum.intra.norang.ca> Reply-To: nicholas.dokos@hp.com Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mx6o6-0004wC-8l for emacs-orgmode@gnu.org; Sun, 11 Oct 2009 18:22:26 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mx6o1-0004vR-OC for emacs-orgmode@gnu.org; Sun, 11 Oct 2009 18:22:25 -0400 Received: from [199.232.76.173] (port=52253 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mx6o1-0004vO-JE for emacs-orgmode@gnu.org; Sun, 11 Oct 2009 18:22:21 -0400 Received: from vms173001pub.verizon.net ([206.46.173.1]:41534) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mx6o1-0006RF-9j for emacs-orgmode@gnu.org; Sun, 11 Oct 2009 18:22:21 -0400 Received: from gamaville.dokosmarshall.org ([98.110.172.159]) by vms173001.mailsrvcs.net (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 32bit)) with ESMTPA id <0KRD00B2SFE7XE80@vms173001.mailsrvcs.net> for emacs-orgmode@gnu.org; Sun, 11 Oct 2009 17:20:31 -0500 (CDT) In-reply-to: Message from Robert P. Goldman of "Sun, 11 Oct 2009 16:10:39 -0000." 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 P. Goldman" Cc: emacs-orgmode@gnu.org 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. HTH, Nick