From 2891e0500265df24461d85493e70c1d31c095408 Mon Sep 17 00:00:00 2001 From: "Toby S. Cubitt" Date: Wed, 17 Oct 2012 20:48:41 +0200 Subject: [PATCH] Allow separate format for clocksum lines longer than 1 day. Configured by new org-time-clocksum-days-format customization option. --- lisp/org-colview.el | 7 +++++-- lisp/org.el | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lisp/org-colview.el b/lisp/org-colview.el index 9d58b5f..244458f 100644 --- a/lisp/org-colview.el +++ b/lisp/org-colview.el @@ -1058,8 +1058,11 @@ Don't set this, this is meant for dynamic scoping.") ((memq fmt '(estimate)) (org-estimate-print n printf)) ((not (numberp n)) "") ((memq fmt '(add_times max_times min_times mean_times)) - (let* ((h (floor n)) (m (floor (+ 0.5 (* 60 (- n h)))))) - (format org-time-clocksum-format h m))) + (let* ((h (floor n)) (m (floor (+ 0.5 (* 60 (- n h))))) (d (/ h 24))) + (if (or (= d 0) (null org-time-clocksum-days-format)) + (format org-time-clocksum-format h m) + (setq h (- h (* 24 d))) + (format org-time-clocksum-days-format d h m)))) ((eq fmt 'checkbox) (cond ((= n (floor n)) "[X]") ((> n 1.) "[-]") diff --git a/lisp/org.el b/lisp/org.el index 2aa70bd..2eb65d6 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -2720,6 +2720,12 @@ This is also used when org-mode generates a time duration." :group 'org-time :type 'string) +(defcustom org-time-clocksum-days-format "%dd %d:%02d" + "The format string used for CLOCKSUM lines longer than 1 day. +If null, fall back to `org-time-clocksum-format'." + :group 'org-time + :type '(choice (string :tag "format") (const :tag "disabled" nil))) + (defcustom org-time-clocksum-use-fractional nil "If non-nil, \\[org-clock-display] uses fractional times. org-mode generates a time duration." -- 1.7.8.6