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

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

[emacs-wiki-discuss] Re: Automatically scheduling tasks onto TaskPool


From: Sacha Chua
Subject: [emacs-wiki-discuss] Re: Automatically scheduling tasks onto TaskPool
Date: Thu, 09 Jun 2005 17:56:01 +0800
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

Sacha Chua <address@hidden> writes:

> We'll probably need to start thinking about the fact that your task
> pool can get Very, Very Big. Do you want completed tasks to still be
> displayed on your TaskPool? If not, here's another snippet that will
> unschedule tasks from TaskPool when you mark them completed with C-c
> C-x (planner-task-done). Nifty stuff, huh?

Using the newly-committed planner-mark-task-hook, the following code
cooperates with planner-timeclock a bit better.

(defun paul/planner-remove-completed-task-from-pool (old-status new-status)
  "Remove completed tasks from the TaskPool if that still leaves them linked.
OLD-STATUS and NEW-STATUS are supplied by from `planner-mark-task'."
  (when (string= old-status "X")
    (let ((info (planner-current-task-info)))
      
      (when (planner-task-link-text info)
        ;; If it is linked to TaskPool _and_ at least one other thing
        (if (string-match planner-multi-separator (planner-task-link-text info))
            (save-excursion
              (planner-multi-replan-task
               (planner-multi-make-link
                (planner-multi-filter-links "^TaskPool$" 
(planner-multi-task-link-as-list info) t))))
          ;; Else if it has a date and is linked to TaskPool
          (if (and (planner-task-date info)
                   (string= (planner-task-link info) "TaskPool"))
              (planner-replan-task nil)))))))
(add-hook 'planner-mark-task-hook 'paul/planner-remove-completed-task-from-pool 
t)

-- 
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]