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

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

[emacs-wiki-discuss] Re: New behavior when marking tasks complete?


From: Sacha Chua
Subject: [emacs-wiki-discuss] Re: New behavior when marking tasks complete?
Date: Thu, 30 Jun 2005 17:06:47 +0800
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

"Charles philip Chan" <address@hidden> writes:

>> planner-sort-tasks moves the point around. dev/434 makes sure to keep
>> the point on the same task if planner-sort-tasks is called, but I
>> don't know whether that's reasonable behavior. What do people think?
> I think it should go to the next open task.

Okay. That's probably not a planner-sort-tasks thing, but rather
something to add to planner-mark-task-hook.

(defun cpc/planner-seek-next-open-task (old-status new-status)
 "Find the next open task."
 (when (string-match status "XC")
   (let ((continue t))
     (while continue
       (if (re-search-forward planner-task-regexp nil t)
           (let ((status (planner-task-status (planner-current-task-info))))
             (unless (string-match status "XC")
               (goto-char (planner-line-beginning-position))
               (setq continue nil)))
         (setq continue nil))))))
(add-hook 'planner-mark-task-hook 'cpc/planner-seek-next-open-task t)

This positions the point at the beginning of the next open task. You
can do other things with it, of course... =)
-- 
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]