File: timeclock.el.html

This mode is for keeping track of time intervals. You can use it for whatever purpose you like, but the typical scenario is to keep track of how much time you spend working on certain projects.

Use timeclock-in when you start on a project, and timeclock-out when you're done. Once you've collected some data, you can use timeclock-workday-remaining to see how much time is left to be worked today (where timeclock-workday specifies the length of the working day), and timeclock-when-to-leave to calculate when you're free.

You'll probably want to bind the timeclock commands to some handy keystrokes. Assuming C-c t is unbound, you might use:

  (keymap-set "C-c t i" 'timeclock-in)
  (keymap-set "C-c t o" 'timeclock-out)
  (keymap-set "C-c t c" 'timeclock-change)
  (keymap-set "C-c t r" 'timeclock-reread-log)
  (keymap-set "C-c t u" 'timeclock-update-mode-line)
  (keymap-set "C-c t w" 'timeclock-when-to-leave-string)

If you want Emacs to display the amount of time "left" to your workday in the mode-line, you can either set the value of timeclock-mode-line-display(var)/timeclock-mode-line-display(fun) to t using M-x customize, or you can add this code to your init file:

  (require 'timeclock)
  (timeclock-mode-line-display)

To cancel this mode line display at any time, just call timeclock-mode-line-display(var)/timeclock-mode-line-display(fun) again.

You may also want Emacs to ask you before exiting, if you are currently working on a project. This can be done either by setting timeclock-ask-before-exiting to t using M-x customize (this is the default), or by adding the following to your init file:

  (add-hook 'kill-emacs-query-functions #'timeclock-query-out)

NOTE: If you change your timelog file without using timeclock's functions, or if you change the value of any of timeclock's customizable variables, you should run the command timeclock-reread-log. This will recompute any discrepancies in your average working time, and will make sure that the various display functions return the correct value.

Defined variables (26)

timeclock-ask-before-exitingIf non-nil, ask if the user wants to clock out before exiting Emacs.
timeclock-day-overThe date of the last day when notified "day over" for.
timeclock-day-over-hookA hook that is run when the workday has been completed.
timeclock-discrepancyA variable containing the time discrepancy before the last event.
timeclock-done-hookA hook run every time a project is marked as completed.
timeclock-elapsedA variable containing the time elapsed for complete periods today.
timeclock-event-hookA hook run every time any event is recorded.
timeclock-fileThe file used to store timeclock data in.
timeclock-first-in-hookA hook run for the first "in" event each day.
timeclock-get-project-functionThe function used to determine the name of the current project.
timeclock-get-reason-functionA function used to determine the reason for clocking out.
timeclock-get-workday-functionA function used to determine the length of today’s workday.
timeclock-in-hookA hook run every time an "in" event is recorded.
timeclock-last-eventA list containing the last event that was recorded.
timeclock-last-event-workdayThe number of seconds in the workday of ‘timeclock-last-event’.
timeclock-last-periodInteger representing the number of seconds in the last period.
timeclock-load-hookHook that gets run after timeclock has been loaded.
timeclock-mode-line-displayNon-nil if Timeclock-Mode-Line-Display mode is enabled.
timeclock-mode-line-display-hookHook run after entering or leaving ‘timeclock-mode-line-display’.
timeclock-mode-stringThe timeclock string (optionally) displayed in the mode line.
timeclock-out-hookA hook run every time an "out" event is recorded.
timeclock-relativeWhether to make reported time relative to ‘timeclock-workday’.
timeclock-update-timerThe timer used to update ‘timeclock-mode-string’.
timeclock-use-display-timeIf non-nil, use ‘display-time-hook’ for doing mode line updates.
timeclock-use-elapsedNon-nil if the mode line should display time elapsed, not remaining.
timeclock-workdayThe length of a work period in seconds.

Defined functions (70)

timeclock-ask-for-project()
timeclock-ask-for-reason()
timeclock-change(&optional ARG PROJECT)
timeclock-completing-read(PROMPT ALIST &optional DEFAULT)
timeclock-current-debt(&optional LOG-DATA)
timeclock-currently-in-p()
timeclock-day-alist(&optional LOG-DATA)
timeclock-day-base(&optional TIME)
timeclock-day-begin(DAY)
timeclock-day-break(DAY)
timeclock-day-debt(DAY)
timeclock-day-end(DAY)
timeclock-day-length(DAY)
timeclock-day-list(&optional LOG-DATA)
timeclock-day-list-begin(DAY-LIST)
timeclock-day-list-break(DAY-LIST)
timeclock-day-list-debt(DAY-LIST)
timeclock-day-list-end(DAY-LIST)
timeclock-day-list-length(DAY-LIST)
timeclock-day-list-projects(DAY-LIST)
timeclock-day-list-required(DAY-LIST)
timeclock-day-list-span(DAY-LIST)
timeclock-day-list-template(FUNC DAY-LIST)
timeclock-day-projects(DAY)
timeclock-day-required(DAY)
timeclock-day-span(DAY)
timeclock-entry-begin(timeclock-entry-begin X)
timeclock-entry-begin--inliner(INLINE--FORM X)
timeclock-entry-comment(timeclock-entry-comment X)
timeclock-entry-comment--inliner(INLINE--FORM X)
timeclock-entry-end(timeclock-entry-end X)
timeclock-entry-end--inliner(INLINE--FORM X)
timeclock-entry-final-p(timeclock-entry-final-p X)
timeclock-entry-final-p--inliner(INLINE--FORM X)
timeclock-entry-length(ENTRY)
timeclock-entry-list-begin(ENTRY-LIST)
timeclock-entry-list-break(ENTRY-LIST)
timeclock-entry-list-end(ENTRY-LIST)
timeclock-entry-list-length(ENTRY-LIST)
timeclock-entry-list-projects(ENTRY-LIST)
timeclock-entry-list-span(ENTRY-LIST)
timeclock-entry-project(timeclock-entry-project X)
timeclock-entry-project--inliner(INLINE--FORM X)
timeclock-find-discrep()
timeclock-generate-report(&optional HTML-P)
timeclock-in(&optional ARG PROJECT FIND-PROJECT)
timeclock-last-period(&optional MOMENT)
timeclock-log(CODE &optional PROJECT)
timeclock-log-data(&optional RECENT-ONLY FILENAME)
timeclock-make-hours-explicit(OLD-DEFAULT)
timeclock-mean(L)
timeclock-mode-line-display(&optional ARG)
timeclock-out(&optional ARG REASON FIND-REASON)
timeclock-project-alist(&optional LOG-DATA)
timeclock-query-out()
timeclock-read-moment()
timeclock-reread-log()
timeclock-seconds-to-string(SECONDS &optional SHOW-SECONDS REVERSE-LEADER)
timeclock-seconds-to-time(TIME FORM)
timeclock-status-string(&optional SHOW-SECONDS TODAY-ONLY)
timeclock-time-to-date(&optional TIME)
timeclock-time-to-seconds(&optional SPECIFIED-TIME)
timeclock-update-mode-line()
timeclock-visit-timelog()
timeclock-when-to-leave(&optional TODAY-ONLY)
timeclock-when-to-leave-string(&optional SHOW-SECONDS TODAY-ONLY)
timeclock-workday-elapsed()
timeclock-workday-elapsed-string(&optional SHOW-SECONDS)
timeclock-workday-remaining(&optional TODAY-ONLY)
timeclock-workday-remaining-string(&optional SHOW-SECONDS TODAY-ONLY)

Defined faces (0)