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 <dm...@ictsoc.de> wrote: > 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.... dmj...@jabber.org > Email..... dm...@ictsoc.de > -- 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. _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode