emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Robert P. Goldman <rpgoldman@sift.info>
To: emacs-orgmode@gnu.org
Subject: Re: "clearing" the state of an org-mode subtree
Date: Sun, 11 Oct 2009 16:10:39 +0000 (UTC)	[thread overview]
Message-ID: <loom.20091011T180334-590@post.gmane.org> (raw)
In-Reply-To: 87fx9qw1j8.fsf@gollum.intra.norang.ca

Bernt Hansen <bernt <at> norang.ca> writes:

> Paul Mead <paul.d.mead <at> gmail.com> writes:
> > 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.
> >>
> >> Thanks, everyone,
> >
> > Have you thought about using yasnippet? I have a repeating set of TODOs
> > in a particular order that I have to do every month. Rather than reusing
> > the old structure, I just insert it again from a snippet. That way I
> > also have all my notes from last month too.
> Or copy the subtree _before_ you fill it in with details.  Make a
> repeating task that is just to copy the subtree at the appropriate time
> so the subtree is available for the repeat after this one, and then
> proceed to use one of the copies for the current task iteration.

Yes, this would clearly have been The Right Thing had I realized when I built
the subtree that I might want to use it again.  But I didn't (this seems like a
specific case of the general "code reuse" problem  --- it's nice if you can
foresee that you'd like to reuse something but often that does not happen).

The issue about copying, IIUC, is that the template from which one is to copy
must be kept "out of band" with respect to the agenda.  That is, it must be kept
somewhere (perhaps in an "org-templates.org" file) where the agenda will not see
it, and copied from the templates file into a file that is active wrt the
agenda.  The yasnippet approach fits this.  But again, this is a different use
case --- one in which the user has had the foresight to realize that a task will
be used over and over.

Note that no templating approach (automated by yasnippet or not) supports
learning in the course of this code reuse.  E.g., if I think of something this
year when I am winterizing, and add that new TODO into my currently active copy
of the template, then it won't appear next year if I reinvoke the template.

In general, I'm inclined to think that this case is irregular enough that it's
probably best to simply keep my one working copy and manually clear it every
year when I need another.  It's probably an AI-complete problem to clear an
arbitrary hunk of org back to a pristine state!

Thanks for the discussion,

  reply	other threads:[~2009-10-11 16:11 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 [this message]
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
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:

  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=loom.20091011T180334-590@post.gmane.org \
    --to=rpgoldman@sift.info \
    --cc=emacs-orgmode@gnu.org \


* 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


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