From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Control flow in org-todo drives me crazy Date: Sat, 07 Jun 2014 17:16:06 +0200 Message-ID: <87bnu47nt5.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WtIM9-0006rv-Ov for emacs-orgmode@gnu.org; Sat, 07 Jun 2014 11:16:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WtIM2-0002M1-9N for emacs-orgmode@gnu.org; Sat, 07 Jun 2014 11:16:29 -0400 Received: from plane.gmane.org ([80.91.229.3]:41732) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WtIM2-0002Lr-35 for emacs-orgmode@gnu.org; Sat, 07 Jun 2014 11:16:22 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WtILy-0001Uo-Fw for emacs-orgmode@gnu.org; Sat, 07 Jun 2014 17:16:18 +0200 Received: from e178188108.adsl.alicedsl.de ([85.178.188.108]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 07 Jun 2014 17:16:18 +0200 Received: from tjolitz by e178188108.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 07 Jun 2014 17:16:18 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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