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

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

[emacs-wiki-discuss] Re: culling completed tasks


From: Sacha Chua
Subject: [emacs-wiki-discuss] Re: culling completed tasks
Date: Tue, 14 Jun 2005 17:35:37 +0800
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

Alex Polite <address@hidden> writes:

> Is there a way to make planner go through all my pages and remove all
> completed tasks? Or maybe just not display completed tasks?

If you want to kill tasks, you can bind C-c C-x to planner-delete-task
instead of planner-task-done. On the other hand, task completion
information is pretty useful, and the sight of all those crossed-out
tasks is a good morale booster.

Hmm... Here's a function that moves completed tasks to a separate
*Completed page if it exists. For example, if you schedule tasks onto
TestPage, then this will move them to TestPageCompleted if the page
already exists.

(defun alex/planner-move-completed-task (old-status new-status)
  "Move completed tasks to FooCompleted if such a page exists.
Check all the pages mentioned in the task's links for possible archiving pages.
If a Completed page exists, replace the page with the link to the Completed 
page.
If no Completed pages exist, leave the task unchanged."
  (save-excursion
    (when (string= new-status "X")
      (let ((info (planner-current-task-info))
            (suffix "Completed"))
        (when (planner-task-link-text info)
          ;; If it is a multiple-linked task, check all the tasks
          (cond
           ((string-match planner-multi-separator (planner-task-link-text info))
            (let ((list (planner-multi-task-link-as-list info))
                  new-list
                  top)
              (while list
                ;; If there is a Completed link
                (setq top (planner-link-base (car list)))
                (add-to-list 'new-list
                             (if (assoc (concat top suffix) 
(planner-file-alist))
                                 (concat top suffix)
                               top)
                             t)
                (setq list (cdr list)))
              (planner-multi-replan-task (planner-multi-make-link new-list))))
           ((and (planner-task-plan info)
                 (assoc (concat (planner-task-plan info) suffix)
                        (planner-file-alist)))
            (planner-replan-task (concat (planner-task-plan info) 
suffix)))))))))
    
(add-hook 'planner-mark-task-hook 'alex/planner-move-completed-task 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]