emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/calendar/timeclock.el,v


From: John Wiegley
Subject: [Emacs-diffs] Changes to emacs/lisp/calendar/timeclock.el,v
Date: Wed, 09 Aug 2006 11:51:58 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     John Wiegley <johnw>    06/08/09 11:51:57

Index: timeclock.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/calendar/timeclock.el,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37
--- timeclock.el        8 Feb 2006 07:54:11 -0000       1.36
+++ timeclock.el        9 Aug 2006 11:51:57 -0000       1.37
@@ -95,7 +95,7 @@
   :group 'timeclock)
 
 (defcustom timeclock-relative t
-  "*Whether to maken reported time relative to `timeclock-workday'.
+  "*Whether to make reported time relative to `timeclock-workday'.
 For example, if the length of a normal workday is eight hours, and you
 work four hours on Monday, then the amount of time \"remaining\" on
 Tuesday is twelve hours -- relative to an averaged work period of
@@ -251,7 +251,10 @@
 This value is not accurate enough to be useful by itself.  Rather,
 call `timeclock-workday-elapsed', to determine how much time has been
 worked so far today.  Also, if `timeclock-relative' is nil, this value
-will be the same as `timeclock-discrepancy'.") ; ? gm
+will be the same as `timeclock-discrepancy'.")
+
+(defvar timeclock-use-elapsed nil
+  "Non-nil if the modeline should display time elapsed, not remaining.")
 
 (defvar timeclock-last-period nil
   "Integer representing the number of seconds in the last period.
@@ -424,7 +427,9 @@
 If TODAY-ONLY is non-nil, the display will be relative only to time
 worked today, ignoring the time worked on previous days."
   (interactive "P")
-  (let ((remainder (timeclock-workday-remaining)) ; today-only?
+  (let ((remainder (timeclock-workday-remaining
+                   (or today-only
+                       (not timeclock-relative))))
         (last-in (equal (car timeclock-last-event) "i"))
         status)
     (setq status
@@ -619,7 +624,10 @@
 The value of `timeclock-relative' affects the display as described in
 that variable's documentation."
   (interactive)
-  (let ((remainder (timeclock-workday-remaining (not timeclock-relative)))
+  (let ((remainder
+        (if timeclock-use-elapsed
+            (timeclock-workday-elapsed)
+          (timeclock-workday-remaining (not timeclock-relative))))
         (last-in (equal (car timeclock-last-event) "i")))
     (when (and (< remainder 0)
               (not (and timeclock-day-over




reply via email to

[Prev in Thread] Current Thread [Next in Thread]