summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2009-07-26 06:05:09 +0800
committerBastien Guerry <bzg@altern.org>2009-07-26 06:05:09 +0800
commit593022a66e856de42dcad60037674a900f2fe9cd (patch)
treea371581e66f13f413242115790e9c71513d6c9cf
parentc39f5d632f9e8ea25b8558c009780f5934fd4267 (diff)
downloadorg-mode-593022a66e856de42dcad60037674a900f2fe9cd.tar.gz
Add a new :timestamp option for clock reports.
Using :timetamp t as an option in a clock report now allows insertion of the timestamp for the clocked entry. Timestamps are searched for in this order: SCHEDULING, TIMESTAMP, DEADLINE and TIMESTAMP_IA.
-rw-r--r--doc/ChangeLog5
-rw-r--r--doc/org.texi2
-rwxr-xr-xlisp/ChangeLog3
-rw-r--r--lisp/org-clock.el19
4 files changed, 24 insertions, 5 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 264ae4c..00bd23e 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-26 Bastien Guerry <bzg@altern.org>
+
+ * org.texi (Clocking work time): Add documentation for the
+ new :timetamp option when creating a clock report.
+
2009-07-26 Dan Griswold <dgriswol@rochester.rr.com> (tiny change)
* org.texi (Paragraphs): Fix many typos.
diff --git a/doc/org.texi b/doc/org.texi
index 6a228fb..e28b185 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -5439,6 +5439,8 @@ new table. The @samp{BEGIN} line can specify options:
@r{As a special case, @samp{:formula %} adds a column with % time.}
@r{If you do not specify a formula here, any existing formula.}
@r{below the clock table will survive updates and be evaluated.}
+:timestamp @r{A timestamp for the entry, when available. Look for SCHEDULED,}
+ @r{DEADLINE, TIMESTAMP and TIMESTAMP_IA, in this order.}
@end example
To get a clock summary of the current level 1 tree, for the current
day, you could write
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e2a698e..cb66edf 100755
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
2009-07-25 Bastien Guerry <bzg@altern.org>
+ * org-clock.el (org-dblock-write:clocktable): Add a new option
+ :timestamp which allows display of timestamps in clock reports.
+
* org.el (org-mode-map): Define new key `C-c C-*': convert a plain
list to a subtree, preserving the structure of the list.
(org-set-emph-re): Make the last element optional in the regexp.
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 8d70fd3..9275433 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1192,11 +1192,12 @@ the currently selected interval size."
(maxlevel (or (plist-get params :maxlevel) 3))
(step (plist-get params :step))
(emph (plist-get params :emphasize))
+ (timestamp (plist-get params :timestamp))
(ts (plist-get params :tstart))
(te (plist-get params :tend))
(block (plist-get params :block))
(link (plist-get params :link))
- ipos time p level hlc hdl content recalc formula pcol
+ ipos time p level hlc hdl tsp props content recalc formula pcol
cc beg end pos tbl tbl1 range-text rm-file-column scope-is-list st)
(setq org-clock-file-total-minutes nil)
(when step
@@ -1301,10 +1302,18 @@ the currently selected interval size."
(save-match-data
(org-make-org-heading-search-string
(match-string 2))))
- (match-string 2))))
+ (match-string 2)))
+ tsp (when timestamp
+ (setq props (org-entry-properties (point)))
+ (or (cdr (assoc "SCHEDULED" props))
+ (cdr (assoc "TIMESTAMP" props))
+ (cdr (assoc "DEADLINE" props))
+ (cdr (assoc "TIMESTAMP_IA" props)))))
(if (and (not multifile) (= level 1)) (push "|-" tbl))
(push (concat
- "| " (int-to-string level) "|" hlc hdl hlc " |"
+ "| " (int-to-string level) "|"
+ (if timestamp (concat tsp "|") "")
+ hlc hdl hlc " |"
(make-string (1- level) ?|)
hlc (org-minutes-to-hh:mm-string time) hlc
" |") tbl))))))
@@ -1323,12 +1332,12 @@ the currently selected interval size."
(if block (concat ", for " range-text ".") "")
"\n\n"))
(if scope-is-list "|File" "")
- "|L|Headline|Time|\n")
+ "|L|" (if timestamp "Timestamp|" "") "Headline|Time|\n")
(setq total-time (or total-time org-clock-file-total-minutes))
(insert-before-markers
"|-\n|"
(if scope-is-list "|" "")
- "|"
+ (if timestamp "|Timestamp|" "|")
"*Total time*| *"
(org-minutes-to-hh:mm-string (or total-time 0))
"*|\n|-\n")