From: Carsten Dominik <carsten.dominik@gmail.com>
To: Robert Goldman <rpgoldman@sift.info>
Cc: emacs-orgmode@gnu.org
Subject: Re: Re: "clearing" the state of an org-mode subtree
Date: Mon, 12 Oct 2009 14:46:44 +0200 [thread overview]
Message-ID: <9A49E5D9-DBBE-4C98-9B41-2D91180FCC40@gmail.com> (raw)
In-Reply-To: <4AD32385.4070709@sift.info>
On Oct 12, 2009, at 2:39 PM, Robert Goldman wrote:
> Nick Dokos wrote:
>> Robert P. Goldman <rpgoldman@sift.info> wrote:
>>
>> ...
>>>>> Robert Goldman <rpgoldman <at> 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
next prev parent reply other threads:[~2009-10-12 12:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-09 21:28 "clearing" the state of an org-mode subtree Robert Goldman
2009-10-09 23:43 ` Andrew Stribblehill
2009-10-10 17:23 ` Darlan Cavalcante Moreira
2009-10-10 17:47 ` Robert Goldman
2009-10-11 9:47 ` Paul Mead
2009-10-11 12:36 ` Bernt Hansen
2009-10-11 16:10 ` Robert P. Goldman
2009-10-11 16:46 ` Bernt Hansen
2009-10-11 22:21 ` Nick Dokos
2009-10-12 12:39 ` Robert Goldman
2009-10-12 12:46 ` Carsten Dominik [this message]
2009-10-11 15:11 ` Gregory J. Grubbs
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9A49E5D9-DBBE-4C98-9B41-2D91180FCC40@gmail.com \
--to=carsten.dominik@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=rpgoldman@sift.info \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.