0

I have a couple of org-capture templates that insert tasks/notes under a header called re-organize, I'm looking to update the to do state and deadline of that re-organize header after org-capture finishes.

to illustrate, let's say the current file content looks like this:

* header 1
* header 2
* header N
* DONE re-organize
DEADLINE: >a timestamp of yesterday at 5pm<
** task/note to refill 1

and then if I insert task/note to refill 2 via one of my org-capture templates this should result in this file structure:

* header 1
* header 2
* header N
* TODO re-organize
DEADLINE: >a timestamp of today at 5pm<
** task/note to refill 1
** task/note to refill 2

How can I achieve this?

3
  • I would suggest adding some additional conditions to the question so that a custom function can be written and attached to an org capture finalize hook and only operate on the parent heading if said conditions are met. Because the reader of this thread is presently required to guess what conditions may apply based upon the minimal working example, the answer will probably not be exactly what you are looking for. E.g., the parent heading must contain the words ...; or, the parent heading must contain a certain tag, etc. All we have now is the fact that it is DONE and it says "re-organize".
    – lawlist
    Sep 5, 2020 at 17:04
  • 1
    Alternatively, perhaps the capture template would only be used when you already know the parent heading must be updated; in which case, the answer may be slightly different ...
    – lawlist
    Sep 5, 2020 at 17:10
  • 1
    See also "How can I make a post-capture hook run only for certain capture templates?": emacs.stackexchange.com/questions/45270/… and "Calling a fuction after org capturing": emacs.stackexchange.com/questions/48533/…
    – lawlist
    Sep 5, 2020 at 18:17

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.