[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[emacs-wiki-discuss] bug fix: planner-timeclock-summary.el
From: |
Dryice Liu |
Subject: |
[emacs-wiki-discuss] bug fix: planner-timeclock-summary.el |
Date: |
Wed, 15 Dec 2004 16:21:21 +0800 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (berkeley-unix) |
Hi,
I just realize that the code for "%L" and "%E" in
planner-timeclock-summary-make-summary-string works differently (well,
oppositely) as documented in
planner-timeclock-summary-summary-string.
And as replace-in-string depends on case-fold-search, if
case-fold-search is set to t (the default), "%S" and "%R" will never
work (cause there's "%s" and "%r" before them in the code).
The attached patch should fix it and now it should work as
documented. Sorry folks.
======================================================================
--- planner-timeclock-summary.el.orig Wed Dec 15 10:13:46 2004
+++ planner-timeclock-summary.el Wed Dec 15 16:02:30 2004
@@ -309,12 +309,13 @@
(data (planner-timeclock-one-day-entry-no-date date))
begin end last Span span)
(setq begin (timeclock-day-begin data))
- (setq end (timeclock-day-end data))
+ (setq last (timeclock-day-end data))
(if (string-equal date (format-time-string "%Y/%m/%d"))
- (setq last (current-time))
- (setq last end))
+ (setq end (current-time))
+ (setq end last))
(setq span (timeclock-time-to-seconds (time-subtract last begin)))
(setq Span (timeclock-time-to-seconds (time-subtract end begin)))
+ (let ((case-fold-search nil))
(setq target-string
(replace-in-string target-string "%B"
(format-time-string "%H:%M:%S" begin) t))
@@ -338,7 +339,7 @@
(format "%2.1f%%" (* 100 (/ total span))) t))
(setq target-string
(replace-in-string target-string "%R"
- (format "%2.1f%%" (* 100 (/ total Span))) t))))
+ (format "%2.1f%%" (* 100 (/ total Span))) t)))))
(defun planner-timeclock-summary-extract-task-data (entry)
"Parse ENTRY and return a list of of the form (project task length).
======================================================================
--
Cheers,
Dryice
http://dryice.3322.org
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [emacs-wiki-discuss] bug fix: planner-timeclock-summary.el,
Dryice Liu <=