Movatterモバイル変換


[0]ホーム

URL:


Next:, Previous:, Up:Progress Logging   [Contents][Index]


5.3.2 Tracking TODO state changes

You might want to automatically keep track of when a state changeoccurred and maybe take a note about this change. You can eitherrecord just a timestamp, or a time-stamped note. These records areinserted after the headline as an itemized list, newest first42. When taking a lot ofnotes, you might want to get the notes out of the way into a drawer(seeDrawers). Customize the variableorg-log-into-drawer toget this behavior—the recommended drawer for this is called‘LOGBOOK43. You can also overrulethe setting of this variable for a subtree by setting a‘LOG_INTO_DRAWER’ property.

Since it is normally too much to record a note for every state, Orgmode expects configuration on a per-keyword basis for this. This isachieved by adding special markers ‘!’ (for a timestamp) or ‘@’ (fora note with timestamp) in parentheses after each keyword. Forexample, with the setting

(setq org-todo-keywords      '((sequence "TODO(t)" "WAIT(w@/!)" "|" "DONE(d!)" "CANCELED(c@)")))

You not only define global TODO keywords and fast access keys, butalso request that a time is recorded when the entry is set to ‘DONE’,and that a note is recorded when switching to ‘WAIT’ or‘CANCELED44. The setting for ‘WAIT’ is even more special: the‘!’ after the slash means that in addition to the note taken whenentering the state, a timestamp should be recorded whenleaving the‘WAIT’ state, if and only if thetarget state does not configurelogging for entering it. So it has no effect when switching from‘WAIT’ to ‘DONE’, because ‘DONE’ is configured to record a timestamponly. But when switching from ‘WAIT’ back to ‘TODO’, the ‘/!’ in the‘WAIT’ setting now triggers a timestamp even though ‘TODO’ has nologging configured.

You can use the exact same syntax for setting logging preferences localto a buffer:

#+TODO: TODO(t) WAIT(w@/!) | DONE(d!) CANCELED(c@)

To record a timestamp without a note for TODO keywords configured with‘@’, just typeC-c C-c to enter a blank note when prompted.

In order to define logging settings that are local to a subtree ora single item, define a ‘LOGGING’ property in this entry. Anynon-empty ‘LOGGING’ property resets all logging settings tonil.You may then turn on logging for this specific tree using ‘STARTUP’keywords like ‘lognotedone’ or ‘logrepeat’, as well as adding statespecific settings like ‘TODO(!)’. For example:

* TODO Log each state with only a time  :PROPERTIES:  :LOGGING: TODO(!) WAIT(!) DONE(!) CANCELED(!)  :END:* TODO Only log when switching to WAIT, and when repeating  :PROPERTIES:  :LOGGING: WAIT(@) logrepeat  :END:* TODO No logging at all  :PROPERTIES:  :LOGGING: nil  :END:

Footnotes

(42)

Seethe variableorg-log-states-order-reversed.

(43)

Note that the ‘LOGBOOK’ drawer is unfolded whenpressingSPC in the agenda to show an entry—useC-uSPC to keep it folded here.

(44)

It is possible that Org mode records two timestamps when youare using bothorg-log-done and state change logging. However, itnever prompts for two notes: if you have configured both, the statechange recording note takes precedence and cancel the closing note.


Next:Tracking your habits, Previous:Closing items, Up:Progress Logging   [Contents][Index]


[8]ページ先頭

©2009-2025 Movatter.jp