;;; Exports planner.el schedule entries for use by remind and diary ;; ;; Planner+Remind module ;; Sacha Chua ;; based on John Wiegley's work ;; ;; Canonical URL: http://richip.dhs.org/~sachac/notebook/emacs/remind.el ;; Version: $Id: remind.el,v 1.6 2003/07/27 12:40:28 sacha Exp sacha $ ;; Notes: http://www.emacswiki.org/cgi-bin/wiki.pl?PlannerAndRemind ;; ;; Usage: ;; ;; Download ;; http://richip.dhs.org/~sachac/notebook/emacs/plan2rem ;; http://richip.dhs.org/~sachac/notebook/emacs/rem2diary ;; and put them somewhere in your PATH, or customize ;; remind-plan2rem and remind-rem2diary ;; Add to your .emacs: ;; (require 'remind) ;; ;; Add to your ~/diary (or the file specified by diary-file): ;; #include ~/.diary.planner ;; (Replace ~/.diary.planner with the value of remind-diary-file.) ;; ;; Add to your ~/.reminders: ;; INCLUDE ~/.reminders.planner ;; ;; These files are automatically generated by the functions in this ;; module and should not be manually edited or your changes will be lost. ;; Remember to update your planner file instead of your diary file. ;; If you want your schedule to be automatically updated whenever you ;; save a planner file, put this in your .emacs: ;; ;; (add-hook 'planner-mode-hook ;; (lambda () (interactive) ;; (make-local-hook 'after-save-hook) ;; (add-hook 'after-save-hook 'remind-parse-planner t t) ;; (add-hook 'after-save-hook 'remind-export-to-diary t t))) ;; ;; Alternatively, you can add the following lines to your ;; .emacs file: ;; ;; (defadvice mark-diary-entries (before remind-generate-diary activate) ;; "Generate a diary file from a .reminders file." ;; (remind-parse-planner) ;; (remind-export-to-diary)) ;; ;; TODO: ;; ;; - Be a little more efficient when it comes to parsing the planner; ;; we don't have to parse _everything_ whenever we save. For ;; example, I tend to bunch edits together and then save everything ;; during the publishing process. I could probably just remove it ;; from the after-save-hook. It would be nice to have it kick in ;; when I interactively save one file, but postpone processing until ;; the last file if I'm working with a whole bunch of planner files. ;; - Write a planner-diary.el for people who don't like remind. ;; ;; Thanks to: ;; ;; Jody Klymak - getting me to write some documentation, and suggesting ;; use of remind-diary-file ;; ;; Note: I don't use this module much. If things don't work, please ;; e-mail me at sacha@free.net.ph ;; ;; No guarantees. Might overwrite your scheduling info; keep a backup. (require 'planner) (defgroup remind nil "A module for exporting planner.el schedules to remind and/or diary." :prefix "remind-" :group 'applications) (defcustom remind-planner-file "~/.reminders.planner" "Where reminders extracted from planner files are stored. WARNING: This file will be overwritten whenever you call remind-parse-planner." :type 'file :group 'remind) (defcustom remind-diary-file "~/.diary.planner" "Where diary entries extracted from planner files are stored. WARNING: This file will be overwritten whenever you call remind-export-to-diary." :type 'file :group 'remind) (defcustom remind-plan2rem "plan2rem" "The path of the planner to remind converter." :type 'file :group 'remind) (defcustom remind-rem2diary "rem2diary" "The path of the remind to diary converter." :type 'file :group 'remind) (defun remind-parse-planner () "Extract all appointments from planner files." (interactive) (with-current-buffer (find-file-noselect remind-planner-file) (erase-buffer) (call-process remind-plan2rem nil t nil (expand-file-name planner-directory)) (save-buffer))) (defun remind-export-to-diary () "Convert reminders to diary format, overwriting the file specified by `remind-diary-file'" (interactive) (with-current-buffer (find-file-noselect remind-diary-file) (erase-buffer) (call-process remind-rem2diary nil t nil) (save-buffer))) (provide 'remind)