emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Re: Understanding habits - org-log-done


From: Matt Lundin
Subject: [Orgmode] Re: Understanding habits - org-log-done
Date: Tue, 04 Jan 2011 21:50:05 -0500
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

Bernt Hansen <address@hidden> writes:

> Tommy Kelly <address@hidden> writes:
>
>> For habits to work, he manual says that "You must also have state
>> logging for the DONE state enabled". My experimentation leads me to
>> believe that the state logging must not only be enabled but it must be
>> such that org-log-done is set to 'time and *not* to 'note. I tried the
>> latter and it doesn't seem to be interpreted as a state change. 
>>
>> Is that as it should be?
>>
>> Suppose I want to keep a note. Maybe it's "Go for run" and I want to log
>> time or distance. Is that possible?
>
> I can confirm this.  I personally only log state changes to DONE but
> setting a LOGGING property value of lognotedone prompts for a note and
> fails to show the history for the habit in the graph.
>
> This is probably a bug.

Yes. The regexp that searches for completed tasks in org-habit is
hard-coded to look for a 'State "DONE"' string. When org-log-done is set
to note, however, the log entries begin with 'CLOSING NOTE'. (A related
problem here is that it assumes DONE is the only relevant todo keyword.)

One workaround is to add the property LOGGING and set its value to
lognoterepeat. This produces notes with timestamps in the following
format (compatible with org-habit):

  - State "DONE"       from "TODO"       [2011-01-01 Sat 21:11] \\
    5 miles.

Another workaround is to make the setting associated with 'done in
org-log-note-headings to the same as 'state. One quick way to do that is
by evaluating the following expression:

(setcdr (assoc 'done org-log-note-headings) (assoc 'state 
org-log-note-headings))

As an aside, it seems to me that the "CLOSING NOTE" format that results
when org-log-done is set to 'note is inconsistent with other logging
behavior. For instance, when a "@" is added in org-todo-keywords, the
note is entered with the state change string.

Best,
Matt



reply via email to

[Prev in Thread] Current Thread [Next in Thread]