emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Control flow in org-todo drives me crazy
@ 2014-06-07 15:16 Thorsten Jolitz
  0 siblings, 0 replies; only message in thread
From: Thorsten Jolitz @ 2014-06-07 15:16 UTC (permalink / raw)
  To: emacs-orgmode


Hi List, 

assume I call `org-todo' with this in my init.el:

,--------------------------------------------------------
| (setq org-todo-keywords
|       (quote
|        ((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d!/!)")
|         (sequence
|          "WAITING(w@/!)" "HOLD(h@/!)" "|"
|          "CANCELLED(c@/!)" "PHONE"))))
`--------------------------------------------------------

Then:

 1. State changes from e.g. TODO to NEXT and vice versa are not logged
    at all. 

 2. State changes _to_ e.g. WAITING and CANCELLED are logged with a
    user message:

   ,----------------------------------------------------------------
   | - State "CANCELLED"  from "TODO"       [2014-06-07 Sa 15:26] \\
   |   hallo
   `----------------------------------------------------------------

 3. State changes _from_ e.g. WAITING and CANCELLED are logged without
    a user message, but with time and state info:

   ,-------------------------------------------------------------
   | - State "TODO"       from "CANCELLED"  [2014-06-07 Sa 16:07]
   `-------------------------------------------------------------

Now, abstracting away all the details and the use-case:

 1. [don't care]
 2. takes a note from the user, then calls `org-finish-function'

 ,------------------------------
 | TODO state changed to WAITING
 | org-log-note-how: note
 `------------------------------
 
 OK for me, because I can use 'org-finish-function' to "hook in" with my
 own functions after command `org-todo' (and subsequent functions) did
 their work.

 3. does not take a note from the user (=> and thus does not call
    `org-finish-function')

 ,------------------------------------------
 | TODO state changed (from WAITING) to NEXT
 | org-log-note-how: time
 `------------------------------------------

 How and where can I "hook in" after org-todo and org-store-log-note
 did their work in this case? There is no hook, no finish-function,
 and I can't even find the point in the code where control flow enters
 this third branch (well, except the place where `org-log-note-how' is
 evaluated maybe, but its kind of opaque ...)

 Maybe somebody with good knowledge of this code could give me a hint?

-- 
cheers,
Thorsten

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-06-07 15:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-07 15:16 Control flow in org-todo drives me crazy Thorsten Jolitz

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