emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Need help understanding how to limit a function to a tree


From: mediapathic steen
Subject: [O] Need help understanding how to limit a function to a tree
Date: Wed, 28 Feb 2018 16:36:26 -0800

I have a subtree that contains a daily list of things to do (which I keep as 
TODOs rather than checklist form for more granular time tracking). I want to 
reset all of the DONE to TODO every day when I start it. Right now I have this 
piece of code I copypasted from somewhere now lost (possibly this very group):

(org-map-entries (lambda ()
          (when
              (string=
               (nth 2 (org-heading-components)) "DONE")
               (org-todo "TODO"))))

This more or less makes sense to me. I have this code sitting in the subtree, 
and  in order to do my daily reset, I edit the subtree in an indirect buffer, 
eval-region the code, then kill the buffer. 

What I would like to accomplish: 
1) Can you help me understand how to modify this code so that it only applies 
to the subtree it's run in (parents also would be fine in this case but not 
necessary and seems more of a challenge)? Doing the indirect buffer thing seems 
more hassle than is reasonable. 

2) I think I understand how to put this in my init in such a way that I can C-x 
invoke it, rather than having to eval-region it, but I'm not certain. Can you 
point me toward a reasonable tutorial or hints on how to do that in general?

Thanks in advance,
-- Steen


reply via email to

[Prev in Thread] Current Thread [Next in Thread]