aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2004-04-04 21:30:49 +0000
committerEli Zaretskii2004-04-04 21:30:49 +0000
commita9dfccd6ae92d01285267ec09a04434112ba1675 (patch)
tree7ade8250deceb9fbfb4dcbacdfa9ca730ddfb1e4
parent6f1a3d53d7ad2a72fe994e3a3787b334bde9bb4e (diff)
downloademacs-a9dfccd6ae92d01285267ec09a04434112ba1675.tar.gz
emacs-a9dfccd6ae92d01285267ec09a04434112ba1675.zip
(timeclock-relative)
(timeclock-get-project-function, timeclock-get-workday-function) (timeclock-query-out, timeclock-when-to-leave) (timeclock-when-to-leave-string, timeclock-log-data) (timeclock-generate-report, timeclock-in): Doc fixes.
-rw-r--r--lisp/calendar/timeclock.el53
1 files changed, 27 insertions, 26 deletions
diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el
index 6e4a380133b..0507ddab64a 100644
--- a/lisp/calendar/timeclock.el
+++ b/lisp/calendar/timeclock.el
@@ -1,6 +1,6 @@
1;;; timeclock.el --- mode for keeping track of how much you work 1;;; timeclock.el --- mode for keeping track of how much you work
2 2
3;; Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc. 3;; Copyright (C) 1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
4 4
5;; Author: John Wiegley <johnw@gnu.org> 5;; Author: John Wiegley <johnw@gnu.org>
6;; Created: 25 Mar 1999 6;; Created: 25 Mar 1999
@@ -60,7 +60,7 @@
60;; `timeclock-modeline-display' again. 60;; `timeclock-modeline-display' again.
61 61
62;; You may also want Emacs to ask you before exiting, if you are 62;; You may also want Emacs to ask you before exiting, if you are
63;; current working on a project. This can be done either by setting 63;; currently working on a project. This can be done either by setting
64;; `timeclock-ask-before-exiting' to t using M-x customize (this is 64;; `timeclock-ask-before-exiting' to t using M-x customize (this is
65;; the default), or by adding the following to your .emacs file: 65;; the default), or by adding the following to your .emacs file:
66;; 66;;
@@ -94,7 +94,7 @@
94 :group 'timeclock) 94 :group 'timeclock)
95 95
96(defcustom timeclock-relative t 96(defcustom timeclock-relative t
97 "*When reporting time, make it relative to `timeclock-workday'? 97 "*Whether to maken reported time relative to `timeclock-workday'.
98For example, if the length of a normal workday is eight hours, and you 98For example, if the length of a normal workday is eight hours, and you
99work four hours on Monday, then the amount of time \"remaining\" on 99work four hours on Monday, then the amount of time \"remaining\" on
100Tuesday is twelve hours -- relative to an averaged work period of 100Tuesday is twelve hours -- relative to an averaged work period of
@@ -107,7 +107,7 @@ previous days. This only affects the timeclock modeline display."
107(defcustom timeclock-get-project-function 'timeclock-ask-for-project 107(defcustom timeclock-get-project-function 'timeclock-ask-for-project
108 "*The function used to determine the name of the current project. 108 "*The function used to determine the name of the current project.
109When clocking in, and no project is specified, this function will be 109When clocking in, and no project is specified, this function will be
110called to determine what the current project to be worked on is. 110called to determine what is the current project to be worked on.
111If this variable is nil, no questions will be asked." 111If this variable is nil, no questions will be asked."
112 :type 'function 112 :type 'function
113 :group 'timeclock) 113 :group 'timeclock)
@@ -115,7 +115,7 @@ If this variable is nil, no questions will be asked."
115(defcustom timeclock-get-reason-function 'timeclock-ask-for-reason 115(defcustom timeclock-get-reason-function 'timeclock-ask-for-reason
116 "*A function used to determine the reason for clocking out. 116 "*A function used to determine the reason for clocking out.
117When clocking out, and no reason is specified, this function will be 117When clocking out, and no reason is specified, this function will be
118called to determine what the reason is. 118called to determine what is the reason.
119If this variable is nil, no questions will be asked." 119If this variable is nil, no questions will be asked."
120 :type 'function 120 :type 'function
121 :group 'timeclock) 121 :group 'timeclock)
@@ -123,17 +123,17 @@ If this variable is nil, no questions will be asked."
123(defcustom timeclock-get-workday-function nil 123(defcustom timeclock-get-workday-function nil
124 "*A function used to determine the length of today's workday. 124 "*A function used to determine the length of today's workday.
125The first time that a user clocks in each day, this function will be 125The first time that a user clocks in each day, this function will be
126called to determine what the length of the current workday is. If 126called to determine what is the length of the current workday. If
127the return value is nil, or equal to `timeclock-workday', nothing special 127the return value is nil, or equal to `timeclock-workday', nothing special
128will be done. If it is a quantity different from `timeclock-workday', 128will be done. If it is a quantity different from `timeclock-workday',
129however, a record will be output to the timelog file to note the fact that 129however, a record will be output to the timelog file to note the fact that
130that day has a different length from the norm." 130that day has a length that is different from the norm."
131 :type '(choice (const nil) function) 131 :type '(choice (const nil) function)
132 :group 'timeclock) 132 :group 'timeclock)
133 133
134(defcustom timeclock-ask-before-exiting t 134(defcustom timeclock-ask-before-exiting t
135 "*If non-nil, ask if the user wants to clock out before exiting Emacs. 135 "*If non-nil, ask if the user wants to clock out before exiting Emacs.
136This variable only has an effect if set with \\[customize]." 136This variable only has effect if set with \\[customize]."
137 :set (lambda (symbol value) 137 :set (lambda (symbol value)
138 (if value 138 (if value
139 (add-hook 'kill-emacs-query-functions 'timeclock-query-out) 139 (add-hook 'kill-emacs-query-functions 'timeclock-query-out)
@@ -151,9 +151,9 @@ This variable only has an effect if set with \\[customize]."
151 151
152(defcustom timeclock-use-display-time t 152(defcustom timeclock-use-display-time t
153 "*If non-nil, use `display-time-hook' for doing modeline updates. 153 "*If non-nil, use `display-time-hook' for doing modeline updates.
154The advantage to this is that it means one less timer has to be set 154The advantage of this is that one less timer has to be set running
155running amok in Emacs' process space. The disadvantage is that it 155amok in Emacs' process space. The disadvantage is that it requires
156requires you to have `display-time' running. If you don't want to use 156you to have `display-time' running. If you don't want to use
157`display-time', but still want the modeline to show how much time is 157`display-time', but still want the modeline to show how much time is
158left, set this variable to nil. Changing the value of this variable 158left, set this variable to nil. Changing the value of this variable
159while timeclock information is being displayed in the modeline has no 159while timeclock information is being displayed in the modeline has no
@@ -240,7 +240,7 @@ The format of this list is (CODE TIME PROJECT).")
240Normally, timeclock assumes that you intend to work for 240Normally, timeclock assumes that you intend to work for
241`timeclock-workday' seconds every day. Any days in which you work 241`timeclock-workday' seconds every day. Any days in which you work
242more or less than this amount is considered either a positive or 242more or less than this amount is considered either a positive or
243negative discrepancy. If you work in such a manner that the 243a negative discrepancy. If you work in such a manner that the
244discrepancy is always brought back to zero, then you will by 244discrepancy is always brought back to zero, then you will by
245definition have worked an average amount equal to `timeclock-workday' 245definition have worked an average amount equal to `timeclock-workday'
246each day.") 246each day.")
@@ -254,8 +254,8 @@ will be the same as `timeclock-discrepancy'.") ; ? gm
254 254
255(defvar timeclock-last-period nil 255(defvar timeclock-last-period nil
256 "Integer representing the number of seconds in the last period. 256 "Integer representing the number of seconds in the last period.
257Note that you shouldn't access this value, but should use the function 257Note that you shouldn't access this value, but instead should use the
258`timeclock-last-period' instead.") 258function `timeclock-last-period'.")
259 259
260(defvar timeclock-mode-string nil 260(defvar timeclock-mode-string nil
261 "The timeclock string (optionally) displayed in the modeline. 261 "The timeclock string (optionally) displayed in the modeline.
@@ -343,7 +343,7 @@ weekend). *If not called interactively, ARG should be the number of
343_seconds_ worked today*. This feature only has effect the first time 343_seconds_ worked today*. This feature only has effect the first time
344this function is called within a day. 344this function is called within a day.
345 345
346PROJECT as the project being clocked into. If PROJECT is nil, and 346PROJECT is the project being clocked into. If PROJECT is nil, and
347FIND-PROJECT is non-nil -- or the user calls `timeclock-in' 347FIND-PROJECT is non-nil -- or the user calls `timeclock-in'
348interactively -- call the function `timeclock-get-project-function' to 348interactively -- call the function `timeclock-get-project-function' to
349discover the name of the project." 349discover the name of the project."
@@ -446,17 +446,18 @@ worked today, ignoring the time worked on previous days."
446 446
447;;;###autoload 447;;;###autoload
448(defun timeclock-change (&optional arg project) 448(defun timeclock-change (&optional arg project)
449 "Change to working on a different project, by clocking in then out. 449 "Change to working on a different project.
450With a prefix ARG, consider the previous project as having been 450This clocks out of the current project, then clocks in on a new one.
451finished at the time of changeover. PROJECT is the name of the last 451With a prefix ARG, consider the previous project as finished at the
452project you were working on." 452time of changeover. PROJECT is the name of the last project you were
453working on."
453 (interactive "P") 454 (interactive "P")
454 (timeclock-out arg) 455 (timeclock-out arg)
455 (timeclock-in nil project (interactive-p))) 456 (timeclock-in nil project (interactive-p)))
456 457
457;;;###autoload 458;;;###autoload
458(defun timeclock-query-out () 459(defun timeclock-query-out ()
459 "Ask the user before clocking out. 460 "Ask the user whether to clock out.
460This is a useful function for adding to `kill-emacs-query-functions'." 461This is a useful function for adding to `kill-emacs-query-functions'."
461 (and (equal (car timeclock-last-event) "i") 462 (and (equal (car timeclock-last-event) "i")
462 (y-or-n-p "You're currently clocking time, clock out? ") 463 (y-or-n-p "You're currently clocking time, clock out? ")
@@ -550,7 +551,7 @@ non-nil, the amount returned will be relative to past time worked."
550 551
551;; Should today-only be removed in favour of timeclock-relative? - gm 552;; Should today-only be removed in favour of timeclock-relative? - gm
552(defsubst timeclock-when-to-leave (&optional today-only) 553(defsubst timeclock-when-to-leave (&optional today-only)
553 "Return a time value representing at when the workday ends today. 554 "Return a time value representing the end of today's workday.
554If TODAY-ONLY is non-nil, the value returned will be relative only to 555If TODAY-ONLY is non-nil, the value returned will be relative only to
555the time worked today, and not to past time." 556the time worked today, and not to past time."
556 (timeclock-seconds-to-time 557 (timeclock-seconds-to-time
@@ -565,7 +566,7 @@ the time worked today, and not to past time."
565;;;###autoload 566;;;###autoload
566(defun timeclock-when-to-leave-string (&optional show-seconds 567(defun timeclock-when-to-leave-string (&optional show-seconds
567 today-only) 568 today-only)
568 "Return a string representing at what time the workday ends today. 569 "Return a string representing the end of today's workday.
569This string is relative to the value of `timeclock-workday'. If 570This string is relative to the value of `timeclock-workday'. If
570SHOW-SECONDS is non-nil, the value printed/returned will include 571SHOW-SECONDS is non-nil, the value printed/returned will include
571seconds. If TODAY-ONLY is non-nil, the value returned will be 572seconds. If TODAY-ONLY is non-nil, the value returned will be
@@ -852,8 +853,8 @@ i, o or O. The meanings of the codes are:
852 853
853 h Set the required working time for the given day. This must 854 h Set the required working time for the given day. This must
854 be the first entry for that day. The COMMENT in this case is 855 be the first entry for that day. The COMMENT in this case is
855 the number of hours that must be worked. Floating point 856 the number of hours in this workday. Floating point amounts
856 amounts are allowed. 857 are allowed.
857 858
858 i Clock in. The COMMENT in this case should be the name of the 859 i Clock in. The COMMENT in this case should be the name of the
859 project worked on. 860 project worked on.
@@ -1144,7 +1145,7 @@ If optional argument TIME is non-nil, use that instead of the current time."
1144 (apply 'encode-time decoded))) 1145 (apply 'encode-time decoded)))
1145 1146
1146(defun timeclock-geometric-mean (l) 1147(defun timeclock-geometric-mean (l)
1147 "Compute the geometric mean of the list L." 1148 "Compute the geometric mean of the values in the list L."
1148 (let ((total 0) 1149 (let ((total 0)
1149 (count 0)) 1150 (count 0))
1150 (while l 1151 (while l
@@ -1158,7 +1159,7 @@ If optional argument TIME is non-nil, use that instead of the current time."
1158(defun timeclock-generate-report (&optional html-p) 1159(defun timeclock-generate-report (&optional html-p)
1159 "Generate a summary report based on the current timelog file. 1160 "Generate a summary report based on the current timelog file.
1160By default, the report is in plain text, but if the optional argument 1161By default, the report is in plain text, but if the optional argument
1161HTML-P is non-nil html markup is added." 1162HTML-P is non-nil, HTML markup is added."
1162 (interactive) 1163 (interactive)
1163 (let ((log (timeclock-log-data)) 1164 (let ((log (timeclock-log-data))
1164 (today (timeclock-day-base))) 1165 (today (timeclock-day-base)))