emacs-wiki-discuss
[Top][All Lists]
Advanced

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

[emacs-wiki-discuss] Re: Planner: set priority while planning?


From: Sacha Chua
Subject: [emacs-wiki-discuss] Re: Planner: set priority while planning?
Date: Sun, 05 Jun 2005 16:47:25 +0800
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

Christopher Allan Webber <address@hidden> writes:

> I currently have <f9> t set to planner-create-task-from-buffer.  This
> is very helpful, but I sometimes feel like I would like to be able to
> set the priority while I'm using this function.  Why not put put it
> like this?
> [B] Describe task:
> then pressing C-M-p or C-M-n could raise or lower the priority, while
> in the minibuffer....

Hmm. C-M-p seems like too many fingers for something as useful as
that. Here are two ways to make it easy to specify the priority when you
create a task:

(defadvice planner-create-task-from-buffer (before cwebber activate)
  "Change the priority if specified.
You can set the priority of a task during creation by starting the
task description with #A, #B, or #C. This changes the default task
status."
  (when (string-match "^#\\([ABC]\\)[ \t]" title)
    (setq planner-default-task-priority (match-string 1 title))
    (setq title (substring title (match-end 0)))))

; -----------------------------------------------------------------

(defadvice planner-create-task-from-buffer (around cwebber activate)
  "Change the priority if specified.
You can set the priority of a task during creation by starting the
task description with #A, #B, or #C."
  (if (string-match "^#\\([ABC]\\)[ \t]" title)
      (let ((planner-default-task-priority (match-string 1 title)))
        (setq title (substring title (match-end 0)))
        ad-do-it)
    ad-do-it))

Example:

Describe task: #A Foo bar   (result: high-priority Foo bar task)

Thanks for the suggestion!
-- 
Sacha Chua <address@hidden> - open source geekette
http://sacha.free.net.ph/ - PGP Key ID: 0xE7FDF77C
interests: emacs, gnu/linux, personal information management, CS ed
sachac on irc.freenode.net#emacs . YM: sachachua83




reply via email to

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