[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[emacs-wiki-discuss] weekly-view, cyclic tasks and planner-appts
From: |
Edgar Gonçalves |
Subject: |
[emacs-wiki-discuss] weekly-view, cyclic tasks and planner-appts |
Date: |
Fri, 10 Mar 2006 23:00:57 +0000 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) |
Hi all!
One of the things I missed the most on planner was the weekly-view, that stopped
working after switching from plain diary entries to planner tasks and schedules
with appointments entries. The culprit was the time format. Diary liked some
formats, like "14:45-15:00", but weekly-view wouldn't parse anything like
"@14:45 | 15:00" - not even "14:45-15:00" !
So I added some extra regexps to `diary-time-regexp-list', hoping that would do
the trick. But it didn't! I found out I had to tweak the `diary-entry-times"
function, on "cal-desk-calendar.el" (required by weekly-view), and it did the
trick!
This way I got my weekly schedule with every cyclic planner tasks and schedule
entries. It only has one thing missing: newly created tasks / schedule entries
with appointments won't be retrieved by weekly-view, as they weren't on the
diary file.
Then I tried to include them, adding a hook to list-diary-entries-hook, like the
following:
(defun planner-include-appt-entries ()
"Add diary entries with todays planner appointments."
(dolist (appt (planner-appt-forthcoming-get-appts 0 t))
(let ((date (car appt)) ;; YYYY.MM.DD
(text (cadr appt))) ;; @START-TIME | END-TIME | TEXT - format is'nt
important
(string-match
"\\([0-9][0-9][0-9][0-9]\\).\\([0-9][0-9]\\).\\([0-9][0-9]\\)" date)
(let ((year (string-to-number (match-string 1 date)))
(month (string-to-number (match-string 2 date)))
(day (string-to-number (match-string 3 date))))
(add-to-diary-list (list month day year)
text "")))))
(add-hook 'list-diary-entries-hook 'planner-include-appt-entries)
After looking interesting for the current week (it actually worked), I realized
this wasn't going to work for future weeks: `planner-appt-forthcoming-get-appts'
retrieves appts for n days after the present day or the day after.
Well, all I made (except to the trivial change to cal-desk-calendar.el ) didn't
mess with other people's code. But changing planner-appt the way I need it to be
is going to alter some functions (specifically those related to forthcoming
appointments). So I'd like to ask if someone is planning to do this, or has
thought about this before (or if there is some other way to get a weekly view -
not list-based, but calendar-based). If you don't think it's necessary, I can
make such changes on my local configuration, snarfing
`planner-appt-forthcoming-get-appts' code.
This idea was the result of using my smart phone to plan my life for some time -
I got used to see my appointments to "fill some space" on my time! :)
Cheers.
--
Edgar Gonçalves
Software Engineering Group @ INESC-ID
IST/Technical University of Lisbon
Rua Alves Redol, 9, Room 635
1000-029 Lisboa, Portugal
mailto:address@hidden
http://www.esw.inesc-id.pt/~eemg
- [emacs-wiki-discuss] weekly-view, cyclic tasks and planner-appts,
Edgar Gonçalves <=