From mboxrd@z Thu Jan 1 00:00:00 1970 From: James TD Smith Subject: Re: use todo-keyword to assign category Date: Mon, 19 Oct 2009 03:10:15 +0100 Message-ID: <20091019021015.GJ72276@yog-sothoth.mohorovi.cc> References: <938fae2d0910181740o1aa9b373x951c852a321c7fed@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mzhhc-0004hO-Bq for emacs-orgmode@gnu.org; Sun, 18 Oct 2009 22:10:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MzhhW-0004br-4j for emacs-orgmode@gnu.org; Sun, 18 Oct 2009 22:10:27 -0400 Received: from [199.232.76.173] (port=45169 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MzhhV-0004ba-V8 for emacs-orgmode@gnu.org; Sun, 18 Oct 2009 22:10:21 -0400 Received: from 81-86-40-42.dsl.pipex.com ([81.86.40.42]:53924 helo=yog-sothoth.mohorovi.cc) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MzhhV-00040v-H3 for emacs-orgmode@gnu.org; Sun, 18 Oct 2009 22:10:21 -0400 Content-Disposition: inline In-Reply-To: <938fae2d0910181740o1aa9b373x951c852a321c7fed@mail.gmail.com> 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: Eraldo Helal Cc: Org-Mode Hi Eraldo, On 2009-10-19 02:40:19(+0200), Eraldo Helal wrote: > I have a keyword "CATEGORY" which I use on headlines to make me aware > that they define a category for everything below them. [snip] > Is it possible to let emacs know that every headline with the > "CATEGORY" todo-keyword should be used as a category? [snip] > Any ideas on how to get there or feedback on the idea? I tend to set categories on any task with lots of subtasks for the same reason. I do this by setting the CATEGORY property on the top level task, usually by hand as I want to keep the category names short. I think the inline #+CATEGORY lines are deprecated in favour of using properties. Add the following to your .emacs; --8<---------------cut here---------------start------------->8--- (add-hook 'org-after-todo-state-change-hook (lambda () (if (string= state "CATEGORY") (save-excursion (org-back-to-heading) (org-set-property "CATEGORY" (nth 4 (org-heading-components))))))) --8<---------------cut here---------------end--------------->8--- When you set the todo state of an entry to CATEGORY, it will copy the headline text to the CATEGORY property. James -- |---|