For my planner-gtd.el project i am trying to move tasks off of the 'NextAction' plan page where everything lives to a 'CompletedTasks' plan page. I am trying to do this by writing a hook function for planner-mark-task-hook. But it doesn't seem to be working. It removes the task from NextActions just fine but is not adding it to CompletedTasks.
Perhaps something is going wrong because i am trying to do this in a hook function? Perhaps i should be using an after advice function on planner-mark-task? When i debug this it looks like planner-replan-task (which is an alias for planner-multi-replan-task since i have loaded planner-multi) is removing the task but it never adds it to the new page. Any help will be greatly appreciated. Here is the code i am trying to use: -------------------- (defvar planner-welcome-page-name "NextActions") (defvar planner-gtd-completed-tasks-page "CompletedTasks") (defun planner-gtd-mark-task-hook (old-status new-status) (when (or (string= new-status "C") (string= new-status "X")) (let* ((info (planner-current-task-info)) (links (planner-multi-task-link-as-list info)) (new-links (append (remove planner-welcome-page-name links) (list (planner-make-link planner-gtd-completed-tasks-page))))) (save-excursion (planner-replan-task (mapconcat 'identity new-links planner-multi-separator))) (when (string= (planner-page-name) planner-welcome-page-name) (planner-find-file (car new-links)) (planner-find-task info)))) nil) (remove-hook 'planner-mark-task-hook 'planner-multi-remove-task-from-pool) (add-hook 'planner-mark-task-hook 'planner-gtd-mark-task-hook t) -------------------- _______________________________________________ emacs-wiki-discuss mailing list emacs-wiki-discuss@nongnu.org http://lists.nongnu.org/mailman/listinfo/emacs-wiki-discuss