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

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

[emacs-wiki-discuss] bug in planner-id.el


From: SAITO Fuyuki
Subject: [emacs-wiki-discuss] bug in planner-id.el
Date: Sun, 17 Apr 2005 14:51:58 +0900 (JST)

This is SAITO Fuyuki.
## Sorry, I posted from the wrong e-mail address.  If you got the same
## mail, please ignore it.

I found a bug in planner-id-update-tasks-on-page in the development
version.  This bug occurs when planner-use-task-numbers set to nil.
So far, completed and cancelled tasks are ALWAYS updated even if
option force is nil.  And if you set planner-tasks-file-behavior to
nil,  saving planner pages will bring the `seesaw' behavior: when you
save the day-page, many task pages are modified, and vice versa.

Bug is just one line as follows:

(defun planner-id-update-tasks-on-page (&optional force)
  "Update all tasks on this page.
Completed or cancelled tasks are not updated. This can be added
to `write-file-functions' (CVS Emacs) or `write-file-hooks'.
If FORCE is non-nil, completed and cancelled tasks are also updated."
  (interactive (list current-prefix-arg))
  (save-excursion
    (goto-char (point-min))
    (while (re-search-forward
        (if force
         "^#[ABC][0-9]*\\s-+.\\s-+.+?{{Tasks:[0-9]+}}"
         "^#[ABC][0-9]*\\s-+[^CX]\\s-+.+?{{Tasks:[0-9]+}}") nil t)
      ;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      (planner-update-task)
      ;; Force the next line to be considered even if planner-multi-update-task 
kicked in.
      (forward-line 1)))
  nil)

The regular expression underlined above matches with the task with
status C or X, because planner-use-task-numbers is nil, typical task
is just as follows:

B   X hogehoge

As you see, there is three blank between the priority and the status,
which can match with the bug regular expression.
This is due to the default planner-task-format as "#%s%-2s %s %s%s".

There are some non-smart solution.
First is to correct planner-task-format as "#%s%0s %s %s%s".
Second is to modiffy the bug expression as
"^#[ABC][0-9]*\\s-+[_o>P]\\s-+.+?{{Tasks:[0-9]+}}".

Maybe a smart way is to apply planner-find-task function to search
tasks of neither C nor X status.  But I am too new to read deep
inside through planner sources (thanks to developer for I have used
planner for more than years; and sorry to developer for I have read
the sources from yesterday),  I do not have this kind of solution
yet.

I hope this information is useful.
Thanks in advance.
---
SAITO Fuyuki (address@hidden)
PGP key: 0x1C215616 / FF07 B9E5 5D34 1876 C2A5  7450 0D46 9CAD 1C21 5616




reply via email to

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