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

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

Re: [emacs-wiki-discuss] Re: Questions regarding planner-trunk


From: Michael Heinrich
Subject: Re: [emacs-wiki-discuss] Re: Questions regarding planner-trunk
Date: Sun, 27 Nov 2005 13:41:52 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Hi Seth,

Seth Falcon <address@hidden> writes:

> On 26 Nov 2005, address@hidden wrote:

> Here is my modified planner-read-task function (thanks to Sacha for

thank you, I will try it.

>
> Also, with planner-multi, you can automaticaly have a copy of all
> tasks go to _AllActions by doing:
>
> (setq planner-multi-copy-tasks-to-page "[[_AllActions][A]]")
>

Yes I know, but if you mark a task as completed it will be removed from
"planner-multi-copy-tasks-to-page". I want completed tasks still to be
there.

>> What I already have is a planner-mark-tasks-hook (partly from you
>> and Sacha) which removes the task from _NextActions or _WaitingFor
>> and copies it to the daily page if it gets marked as done or
>> canceled.  If the task gets marked as pending ("P") it will be
>> removed from _NextActions and will be copied to _WaitingFor.
>
> Oh, that sounds useful.
>

Here it is. Be careful I'm a lisp newbie ;-).

(defvar planner-gtd-next-actions-page "_NextActions")
(defvar planner-gtd-waiting-for-page "_WaitingFor")

(defun mh/planner-mark-task-hook (old-status new-status)
  "Automatically reschedule tasks onto today before marking them as done
or canceled. Also remove them from the next-actions and waiting-for lists.
Add this to `planner-mark-task-hook'."
  (when (or (string= new-status "X")
            (string= new-status "C"))
    (let* ((info (planner-current-task-info))
           (links (planner-multi-task-link-as-list info))
           (new-links (planner-multi-link-delete
                       planner-gtd-next-actions-page links))
           (new-links (planner-multi-link-delete
                       planner-gtd-waiting-for-page new-links)))
      (save-excursion 
        (unless (string= (planner-task-date info) (planner-today))
          (planner-copy-or-move-task (planner-today) t))
        (planner-find-file (planner-today))
        (planner-find-task info)
        (planner-replan-task new-links))))
  (when (string= new-status "P")
    (let* ((info (planner-current-task-info))
           (links (planner-multi-task-link-as-list info))
           (new-links (append (planner-multi-link-delete
                               planner-gtd-next-actions-page links)
                              (list (planner-make-link 
planner-gtd-waiting-for-page)))))
      (save-excursion 
        (planner-replan-task new-links))))    
  t)
(add-hook 'planner-mark-task-hook 'mh/planner-mark-task-hook)


Regards, Michael.




reply via email to

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