emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] use todo-keyword to assign category


From: James TD Smith
Subject: Re: [Orgmode] use todo-keyword to assign category
Date: Mon, 19 Oct 2009 03:10:15 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

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

--
|-<James TD Smith>-<email/address@hidden>-|




reply via email to

[Prev in Thread] Current Thread [Next in Thread]