[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/calendar/timeclock.el, v [EMACS_22_B
From: |
Richard M. Stallman |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/calendar/timeclock.el, v [EMACS_22_BASE] |
Date: |
Thu, 10 May 2007 16:32:31 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Branch: EMACS_22_BASE
Changes by: Richard M. Stallman <rms> 07/05/10 16:32:31
Index: timeclock.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/calendar/timeclock.el,v
retrieving revision 1.38
retrieving revision 1.38.2.1
diff -u -b -r1.38 -r1.38.2.1
--- timeclock.el 21 Jan 2007 02:38:24 -0000 1.38
+++ timeclock.el 10 May 2007 16:32:30 -0000 1.38.2.1
@@ -375,8 +375,9 @@
(setq timeclock-discrepancy
(- (or timeclock-discrepancy 0) workday))
(if (not (= workday timeclock-workday))
- (timeclock-log "h" (and (numberp arg)
- (number-to-string arg))))))
+ (timeclock-log "h" (number-to-string
+ (/ workday (if (zerop (% workday (* 60 60)))
+ 60 60.0) 60))))))
(timeclock-log "i" (or project
(and timeclock-get-project-function
(or find-project (interactive-p))
@@ -651,7 +652,11 @@
"Log the event CODE to the timeclock log, at the time of call.
If PROJECT is a string, it represents the project which the event is
being logged for. Normally only \"in\" events specify a project."
+ (let ((extant-timelog (find-buffer-visiting timeclock-file)))
(with-current-buffer (find-file-noselect timeclock-file)
+ (save-excursion
+ (save-restriction
+ (widen)
(goto-char (point-max))
(if (not (bolp))
(insert "\n"))
@@ -672,10 +677,10 @@
timeclock-discrepancy
(+ timeclock-discrepancy
timeclock-last-period)))
- (setq timeclock-last-event (list code now project)))
+ (setq timeclock-last-event (list code now project)))))
(save-buffer)
(run-hooks 'timeclock-event-hook)
- (kill-buffer (current-buffer))))
+ (unless extant-timelog (kill-buffer (current-buffer))))))
(defvar timeclock-moment-regexp
(concat "\\([bhioO]\\)\\s-+"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/calendar/timeclock.el, v [EMACS_22_BASE],
Richard M. Stallman <=