From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: Re: Re: Force completed habits to revert to "HABIT" todo keyword instead of "TODO" Date: Tue, 09 Nov 2010 22:09:53 +0100 Message-ID: <87fwvaw6e6.wl%dmaus@ictsoc.de> References: <874obqnszr.fsf@fastmail.fm> <87mxpiw6xa.wl%dmaus@ictsoc.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from [140.186.70.92] (port=35320 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PFvS3-0008DD-9G for Emacs-orgmode@gnu.org; Tue, 09 Nov 2010 16:10:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PFvS0-0008DV-PV for Emacs-orgmode@gnu.org; Tue, 09 Nov 2010 16:09:59 -0500 Received: from mailout110.xlhost.de ([213.202.242.110]:34267 helo=mysql1.xlhost.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PFvS0-0008D7-J8 for Emacs-orgmode@gnu.org; Tue, 09 Nov 2010 16:09:56 -0500 In-Reply-To: <87mxpiw6xa.wl%dmaus@ictsoc.de> 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: David Maus Cc: Matt Lundin , Emacs-orgmode@gnu.org, Joseph Buchignani Sorry, I couldn't help myself: (defun hb:set-habit-keyword-2 () "*Reset keyword of done habit." (let ((reset-to (org-entry-get nil "REPEAT_TO_STATE"))) (if (and reset-to (string= state "DONE")) (org-todo reset-to)))) (add-hook 'org-after-todo-state-change-hook 'hb:set-habit-keyword-2) Every time a todo turns into DONE, this function is run and sets the keyword to whatever is stored in REPEAT_TO_STATE. Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber.... dmjena@jabber.org Email..... dmaus@ictsoc.de