Previous: Timeclock, Up: Scheduling and Time


7.2.4 schedule.el

planner-schedule.el allows you to project task completion time. Tasks should be of the form:

     #A0 _ 2h Do something
     #B0 _ 1h30m Do something
     #B0 _ 2d Do something
     #B0 _ 2w Do something
     #B0 _ 10s Do something
     
     s: seconds, m: minutes, h: hours, d: days, w: weeks

schedule.el is included with Planner in the contrib directory, but you can alternatively get it from http://www.newartisans.com/johnw/Emacs/schedule.el if desired.

schedule.el provides a single Lisp function, schedule-completion-time. It takes an Emacs time object and a quantity of seconds. It returns an Emacs time object that represents when the given number of seconds will be completed, assuming that work can only be done during work hours.

The available work hours are affected by several factors:

  1. If timeclock.el is being used, the amount of time left in the current work day (timeclock-workday-remaining) (see Time Intervals)
  2. The amount of time in each work day (schedule-workday)
  3. The definition of a work week (schedule-week)
  4. Any holidays defined in the Emacs calendar (see Holidays)
  5. Any appointments in the Emacs diary (see Appointments)

Taking all of the “block out” periods into account, schedule-completion-time will compute when the given number of seconds will be done, based on your current definitions of time available.

As an example, here's a function which, given a list of durations in seconds, will return a list of completion times starting from the current moment:

     
       (defun compute-completion-times (&rest durations)
         ``Compute completion times for a list of DURATIONS (in seconds).''
         (let ((now (current-time)))
           (mapcar
            (function
             (lambda (dura)
               (setq now (schedule-completion-time now dura))))
            durations)))
     

To call this function, do:

     
     (compute-completion-times 3600 7200 3600)
     

Keys

planner-schedule.el defines the following keybindings:

C-c RET is bound to planner-schedule-show-end-project. C-c C-m is also bound to planner-schedule-show-end-project.

In XEmacs, planner-schedule-show-end-project is bound to C-c C-T c-e and C-c C-S-t C-e.

Functions

planner-schedule.el defines the following interactive functions:

— Function: planner-schedule-show-end-project

Display the estimated project completion time.

schedule.el does not define any interactive functions, or keybindings.