[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[emacs-wiki-discuss] Re: update many tasks at once
From: |
Sacha Chua |
Subject: |
[emacs-wiki-discuss] Re: update many tasks at once |
Date: |
Sat, 17 Sep 2005 18:40:55 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) |
David Ellis <address@hidden> writes:
> Actually, what I doing is adding the tasks outside of emacs. I use a
> Palm planner and have written some VBA macros in Outlook to import and
> export my notes from Outlook to my ~/Plans directory. So I enter a new
> set of tasks on the Palm, synch to Outlook, and then export it to the
> Plans directory. I enter them on the current day's page (e.g.
> 2005.09.17). What I want to do is to update them to copy them to the
> appropriate plan pages.
Ooooooooh! That's awesome! We need to tell emacs-wiki-discuss about
that because lots of people are interested in syncing. =)
Here you go!
(defun david/planner-update-region (beg end)
"Update all tasks from BEG to END."
(interactive (list (point) (mark)))
(let ((start (if (< beg end) beg end))
(finish (if (< beg end) end beg)))
;; Invoke planner-update-task on each line
(with-planner-update-setup
(narrow-to-region
(and (goto-char start) (line-beginning-position))
(and (goto-char (1- finish)) (min (point-max)
(1+ (line-end-position)))))
(goto-char (point-min))
(while (re-search-forward planner-task-regexp nil t)
(planner-update-task)))))
(defun david/planner-update-all ()
"Update all tasks."
(interactive)
(david/planner-update-region (point-min) (point-max)))
--
Sacha Chua <address@hidden> - open source geekette
http://sacha.free.net.ph/ - PGP Key ID: 0xE7FDF77C
interests: emacs, gnu/linux, personal information management, juggling
sachac on irc.freenode.net#emacs . YM: sachachua83