[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[emacs-wiki-discuss] Re: Questions regarding planner-trunk
From: |
Sacha Chua |
Subject: |
[emacs-wiki-discuss] Re: Questions regarding planner-trunk |
Date: |
Thu, 24 Nov 2005 07:18:21 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) |
Seth Falcon <address@hidden> writes:
> It would be neat to have a planner-trunk like functionality that
> matched on the entire task description, not just the plan pages. Then
Does this do the trick?
(defun planner-trunk-sort-tasks (rule)
"Sort tasks by plan name according to the given RULE list."
(let* ((trunk-list (planner-trunk-rule-trunk-sections rule))
(completed-heading (planner-trunk-rule-completed-heading rule))
(task (buffer-substring-no-properties
(planner-line-beginning-position)
(planner-line-end-position)))
(trunk-count (length trunk-list))
(task-completed (planner-trunk-completed-p
(planner-current-task-info))))
(if (not plan)
(+ 2 (if (and completed-heading task-completed)
(* 2 trunk-count)
trunk-count))
(catch 'done
(let ((count 1))
(when (and completed-heading task-completed)
(setq count (+ count trunk-count 2)))
(mapc
(lambda (trunk-entry)
(let ((plan-regexp (planner-trunk-list-regexp trunk-entry)))
(if (string-match plan-regexp task)
(throw 'done count)
(setq count (1+ count)))))
trunk-list)
count)))))
--
Sacha Chua <address@hidden> - open source, free software geekette
http://sacha.free.net.ph/ - PGP Key ID: 0xE7FDF77C
interests: emacs, gnu/linux, personal information management, public speaking
sachac on irc.freenode.net#emacs . YM: sachachua83
[emacs-wiki-discuss] Re: Questions regarding planner-trunk, Sacha Chua, 2005/11/23
Message not available