New option to format the total time cells.

* org-clock.el (org-clock-in-prepare-hook): New option to
format the total time cells.
(org-clocktable-write-default): Use the new option.
This commit is contained in:
Bastien Guerry 2012-03-28 00:49:55 +02:00
parent 122f5fd5b5
commit 7686a81c14
1 changed files with 11 additions and 5 deletions

View File

@ -323,6 +323,12 @@ play with them."
:version "24.1"
:type 'boolean)
(defcustom org-clock-total-time-cell-format "*%s*"
"Format string for the total time cells."
:group 'org-clock
:version "24.1"
:type 'boolean)
(defvar org-clock-in-prepare-hook nil
"Hook run when preparing the clock.
This hook is run before anything happens to the task that
@ -2231,11 +2237,11 @@ from the dynamic block definition."
; file column, maybe
(if level-p "|" "") ; level column, maybe
(if timestamp "|" "") ; timestamp column, maybe
(if properties (make-string (length properties) ?|) "") ;properties columns, maybe
(concat "*" (nth 7 lwords) "*| ") ; instead of a headline
"*"
(org-minutes-to-hh:mm-string (or total-time 0)) ; the time
"*|\n") ; close line
(if properties (make-string (length properties) ?|) "") ; properties columns, maybe
(concat (format org-clock-total-time-cell-format (nth 7 lwords)) "| ") ; instead of a headline
(format org-clock-total-time-cell-format
(org-minutes-to-hh:mm-string (or total-time 0))) ; the time
"|\n") ; close line
;; Now iterate over the tables and insert the data
;; but only if any time has been collected