[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [emacs-wiki-discuss] Re: Better planner/diary integration
From: |
Dryice Liu |
Subject: |
Re: [emacs-wiki-discuss] Re: Better planner/diary integration |
Date: |
Mon, 21 Feb 2005 09:21:53 +0800 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (berkeley-unix) |
Jody Klymak <address@hidden> wrote:
> I consider tasks unscheduled things that need doing (perhaps with a
> deadline), and diary items as things that I must attend at such and
> such a time. This corresponds to GTD "calendar" versus "action
> items". Therefore, I consider the distinction between *Diary* and
> *Tasks* very useful.
I'm in a similar approach. I see diary items as "appointment" that I
have to do at a specific time and "* Schedule" items as "schedule"
which I can ignore (which I often do :)
> I think at some point Sacha has some (python?) code that read a
> "Schedule" section and put the results into a diary file. You could
> maybe check that out and start from there? Maybe someone else
> remembers it better than I do.
Do you mean planner-export-diary.el? Here's how I use it:
I overwrite the planner-export-diary-format-schedule-entries-for-diary
so items from "* Schedule" and "~/.diary" looks different in "* Diary"
and the appt reminder:
======================================================================
;; over write the one in planner-export-diary.el to distinguish the
;; original appointment and the schedule
(defun planner-export-diary-format-schedule-entries-for-diary (list)
"Format LIST as diary entries.
LIST should contain entries of the form [DATE START END
DATA]."
(mapconcat (lambda (item)
(concat
(let ((date (planner-filename-to-calendar-date (elt item 0))))
(format "%02d/%02d/%04d"
(elt date 0)
(elt date 1)
(elt date 2)))
" "
(elt item 1)
"-"
(elt item 2)
" ~~~"
(elt item 3)))
list "\n"))
======================================================================
So say I have
,----
| 09:30 | 10:00 | check emacs wiki mail list
`----
in "* Schedule" and
,----
| Feb 21, 2005 10:00-11:00 a meeting!
`----
in my ~/.diary, I'll get
,----
| 09:30-10:00 ~~~check emacs wiki mail list
| 10:00-11:00 a meeting!
`----
in "* Diary". So when I see an appt reminder starting with "~~~", I
can safely ignore it :) It's kind of like Jim Ottaway's "@" magic but
I can decide if I want to ignore some thing on the fly :)
I also have ddliu-move-time to help me in the "* Schedule"
section:
======================================================================
(defun ddliu-move-time (BEG END offset)
"Add offset minutes to all times in the form HH:MM in a
region. offset can be negative. I use this in the Schedule section of
planner day plan page"
(interactive "r
nMove by minutes: ")
(save-excursion
(save-restriction
(narrow-to-region BEG END)
(goto-char (point-min))
(while (search-forward-regexp
"\\([0-9]?[0-9]:[0-9][0-9]\\(am\\|pm\\)?\\)" nil t)
(let ((time-string (match-string 1))
old-time new-time)
(save-match-data
(setq old-time (appt-convert-time time-string))
(setq new-time (+ old-time offset)))
(replace-match (ddliu-minutes-to-string new-time))))
(widen))))
======================================================================
Also a function planner-add-task-to-schedule like Henrik Hansen's
planner-task-appt-add might be handy too.
--
Dryice @ http://dryice.3322.org
Please avoid sending me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/sylvester-response.html