emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: James Harkins <jamshark70@qq.com>
To: orgmode <emacs-orgmode@gnu.org>
Subject: Hook after handling repeating TODO?
Date: Wed, 05 Nov 2014 11:08:34 +0800	[thread overview]
Message-ID: <87oasmjqdp.wl-jamshark70@qq.com> (raw)

Is there a hook that runs after a TODO state change triggers a repeat?

I have a few weekly tasks that I've set up as habits. These refer to scheduled lessons. I have the idea that it would be pretty cool to include in the habit entry a link pointing to the next lesson. When I mark the habit DONE, it processes the repeat (updates the habit's scheduled time and switches the state back to TODO). That would be the point to find the next lesson for that group of students and update the link text. The most reliable way would be to search for the earliest lesson whose scheduled time is later than the updated timestamp for the habit.

I did some searching but didn't find a hook that appeared obviously to be suitable. I suppose a TODO state-change hook might have worked, provided that the repeating timestamp will be processed before the state change. Unfortunately, it appears that it goes in the opposite order: in org-auto-repeat-maybe, (org-todo to-state) occurs at line 13152, well before processing the new timestamp (13172-13209). So I guess not that one.

Any ideas? Thanks,
hjh

                 reply	other threads:[~2014-11-05  3:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

  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=87oasmjqdp.wl-jamshark70@qq.com \
    --to=jamshark70@qq.com \
    --cc=emacs-orgmode@gnu.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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