Hi list,
after struggling a bit with edebug (too many things to learn) I have
traced what the problem is. For the archives:
State-change logging is deferred until the command finishes and is
implemented by the function 'org-add-log-setup' adding the function
'org-add-log-note' to the hook 'post-command-hook'. The details of the
note are stored in global variables 'org-log-note-xxx'.
That implementation prevents recursive calls to 'org-todo' (that's what
my code does in order the pause the active task) from logging both the
paused and the started log messages.
'org-add-log-note' will be called only once since the hook won't accept
duplicated entries. Anyway, the innermost call to 'org-add-log-setup'
will overwrite the variables 'org-log-note-xxx' with the details of the
note being paused.
The outcome is that only the state change for the paused note is being
logged.
Now that I know what the problem is I only have to figure a workaround.
Any clue?
Regards