From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Brendan Halpin Newsgroups: gmane.emacs.help Subject: Re: reporting using timeclock? Date: 24 Sep 2003 11:17:53 +0100 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1064398781 6827 80.91.224.253 (24 Sep 2003 10:19:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 24 Sep 2003 10:19:41 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 24 12:19:39 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1A26kF-0005RN-00 for ; Wed, 24 Sep 2003 12:19:39 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.22) id 1A26gh-0004VW-Q6 for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Sep 2003 06:15:59 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!wivenhoe.staff8.ul.IE!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 41 Original-NNTP-Posting-Host: wivenhoe.staff8.ul.ie (136.201.147.134) Original-X-Trace: news.uni-berlin.de 1064398324 5194572 136.201.147.134 (16 [139789]) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Original-Xref: shelby.stanford.edu gnu.emacs.help:116834 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:12759 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:12759 ASH JAMES writes: > Is anyone aware of an extension that will summarize a .timelog file, > presenting number of hours worked by project? A late reply... If you're into elisp, timeclock's structures are easy to manipulate, e.g.: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun bhtl-generate-report () (interactive) (switch-to-buffer (get-buffer-create "*TC-Report*")) (delete-region (point-min) (point-max)) (let ((stuff (nth 2 (timeclock-log-data)))) (while stuff (let ((project-data (pop stuff)) (time 0)) (insert (format "%16s: " (pop project-data))) (while project-data (let* ((proj-entry (pop project-data))) (incf time (- (timeclock-time-to-seconds (nth 1 proj-entry)) (timeclock-time-to-seconds (nth 0 proj-entry)))))) (insert (seconds-to-hms time) ?\n))))) (defun seconds-to-hms (secs) (let ((secint (round (ftruncate secs)))) (format "%02d:%02d:%02d" (/ secint 3600) ;; hours (/ (% secint 3600) 60) ;; seconds (% secint 60)))) ;; seconds ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Brendan PS: comments on my lisp style welcome, as usual. -- Brendan Halpin, Department of Sociology, University of Limerick, Ireland Tel: w +353-61-213147 f +353-61-202569 h +353-61-390476; Room F2-025 x 3147 mailto:brendan.halpin@ul.ie http://www.ul.ie/sociology/brendan.halpin.html