From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: Re: Understanding habits - org-log-done Date: Tue, 04 Jan 2011 21:50:05 -0500 Message-ID: <87ipy483oi.fsf@fastmail.fm> References: <877helr2t5.fsf@norang.ca> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=53985 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PaJRx-0006qD-D8 for emacs-orgmode@gnu.org; Tue, 04 Jan 2011 21:50:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PaJRv-0007iU-U9 for emacs-orgmode@gnu.org; Tue, 04 Jan 2011 21:50:09 -0500 Received: from out1.smtp.messagingengine.com ([66.111.4.25]:44855) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PaJRv-0007iP-K5 for emacs-orgmode@gnu.org; Tue, 04 Jan 2011 21:50:07 -0500 In-Reply-To: <877helr2t5.fsf@norang.ca> (Bernt Hansen's message of "Mon, 03 Jan 2011 18:21:42 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bernt Hansen Cc: emacs-orgmode@gnu.org, Tommy Kelly Bernt Hansen writes: > Tommy Kelly 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