I am using planner version 3.41 with muse version 3.11.
I started looking at the sorting functions, since I decided that I
would like tasks on project pages sorted by their date. I found
looking at the documentation string of planner-sort-tasks-by-date that
this is in fact what should be happening by default. However, what is
coded is a sorting that prioritises status first, then date. Looking
at the code also reveals that much of the task info structure is hard
coded into the function, and so does not work in combination with for
example planner-multi if the date link is not the last on the line.
Below is a fix for what I needed. I post this in the hope that others
with more time, will be able to fix the other sort functions in
planner.el in a similar way.
Andrew
(defun afs-planner-sort-tasks-by-date ()
"Sort tasks by date, status and priority."
(skip-chars-forward "#ABC")
(let* ((info (planner-current-task-info))
(status (string-to-char (planner-task-status info)))
(date (planner-task-date info))
(priority (string-to-char (planner-task-priority info))))
(format "%1c%10s%1c"
(if (or (= status ?X)
(= status ?C))
status ?\ )
(if (null date)
planner-sort-undated-tasks-equivalent
date)
priority)))
(defun afs-planner-sort-tasks-default-key ()
"Provide old sorting behavior.
Day pages sort by status and priority. Plan pages sort by date,
status and priority."
(if planner-on-date-page
(planner-sort-tasks-basic)
(afs-planner-sort-tasks-by-date)))
--
Andrew Swann [EMAIL PROTECTED] http://www.imada.sdu.dk/~swann
Department of Mathematics and Computer Science, Tel +45 6550 2354
University of Southern Denmark, Campusvej 55, Dept +45 6550 2387
DK-5230 Odense M, Denmark Fax +45 6593 2691 / +45 6550 2325
_______________________________________________
Planner-el-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/planner-el-discuss