From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joseph Buchignani Subject: Re: Re: Force completed habits to revert to "HABIT" todo keyword instead of "TODO" Date: Wed, 10 Nov 2010 05:17:16 +0800 Message-ID: References: <874obqnszr.fsf@fastmail.fm> <87mxpiw6xa.wl%dmaus@ictsoc.de> <87fwvaw6e6.wl%dmaus@ictsoc.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=36475 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PFvhE-0006cm-LE for Emacs-orgmode@gnu.org; Tue, 09 Nov 2010 16:25:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PFvhD-0002tD-Lr for Emacs-orgmode@gnu.org; Tue, 09 Nov 2010 16:25:40 -0500 Received: from mail-ww0-f49.google.com ([74.125.82.49]:42610) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PFvhD-0002t0-Hh for Emacs-orgmode@gnu.org; Tue, 09 Nov 2010 16:25:39 -0500 Received: by wwe15 with SMTP id 15so7731066wwe.30 for ; Tue, 09 Nov 2010 13:25:38 -0800 (PST) In-Reply-To: <87fwvaw6e6.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 David, I understand what your second function does, but I'm confused about what the first one does. Does the first function set all habits to have a "return to state" property= ? Or does it cause all habits to revert to the "return to state" defined keyword, if it is defined? I was asking how to set "return to state" for all the habits contained in a single file. Since I have a lot of habits and none of them currently have a "return to state" property. Thanks, JB On Wed, Nov 10, 2010 at 5:09 AM, David Maus wrote: > Sorry, I couldn't help myself: > > (defun hb:set-habit-keyword-2 () > =A0"*Reset keyword of done habit." > =A0(let ((reset-to (org-entry-get nil "REPEAT_TO_STATE"))) > =A0 =A0(if (and reset-to (string=3D state "DONE")) > =A0 =A0 =A0 =A0(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, > =A0-- David > -- > OpenPGP... 0x99ADB83B5A4478E6 > Jabber.... dmjena@jabber.org > Email..... dmaus@ictsoc.de > --=20 Ignore the following. It is a nonsense sentence that disables Google ads from displaying next to my emails by triggering sensitive keywords. I enjoy the massacre of ads. This sentence will slaughter ads without a messy bloodbath.