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

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

[emacs-wiki-discuss] planner-cyclic has problems working together with p


From: Sergey Vlasov
Subject: [emacs-wiki-discuss] planner-cyclic has problems working together with planner-multi
Date: Mon, 22 Aug 2005 16:03:37 +0400

Hello!

Looks like the planner-cyclic package does not interoperate well with
planner-multi.  When an entry in planner-cyclic-diary-file contains only
one page name for the task, that task is correctly added both to the
task page and to the current day page.  However, when I try to specify
multiple page names, the task is added only to those pages and does not
appear on the day page at all - this does not seem to be useful.

planner-multi-create-task-from-info has this code (which is used only
for tasks with multiple pages - planner-create-task-from-info-basic is
called for the single-page case):

          (when (or date (planner-task-date info))
            (setq list (planner-multi-filter-links
                        planner-date-regexp
                        list
                        t))
            (add-to-list 'list (or date (planner-task-date info)))
            (setq link-text (planner-multi-make-link list)))

Looks like the intent was to add the day page name to the list of linked
pages if it does not exist there (or replace a day page for a different
date).  However, this code does not really work, because
planner-task-date is advised in planner-multi:

(defadvice planner-task-date (around planner-multi activate)
  "Return the date assigned to this task."
  (if (and (nth 5 info) (listp (nth 5 info)))
      (let ((current (nth 5 info)))
        (while current
          (when (string-match planner-date-regexp (planner-link-base (car 
current)))
            (setq ad-return-value (planner-link-base (car current)))
            (setq current nil))
          (setq current (cdr current))))
    ad-do-it))

Because of this advice, if the task has multiple linked pages, but none
of them is a day page, planner-task-date will always return nil without
looking to the normal date field in the task info.  Therefore calls to
planner-task-date in planner-multi-create-task-from-info are mostly
useless - they never return something different from what is actually in
the list of linked pages (unless someone stuffed more than one day page
there - then that code will remove all such pages except the first one).

Probably the planner-multi advice to planner-task-date is wrong - if the
list of linked pages does not contain anything which looks like a date,
the default implementation should be called instead of returning nil
immediately.  But it would still not work if there is a day page in the
list of linked pages, but the date field in task info contains a
different date - the date from the linked page name will be returned
instead of the date field from the task info.  Which date should take
precedence in this case?

However, if the advice to planner-task-date is actually correct, and the
date field in task-info lists should not be used with planner-multi,
then planner-cyclic-create-task-maybe should supply an explicit argument
to planner-create-task-from-info to override the date in task info (it
would be a noop without planner-id, because the task info already
contains the same date).

-- 
Sergey Vlasov

Attachment: pgpipjsTuzFDH.pgp
Description: PGP signature


reply via email to

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