org-clock: Fix number of columns with :compact parameter
* lisp/org-clock.el (org-clocktable-write-default): Fix number of columns with :compact parameter. Reported-by: Stefan Nobis <stefan-ml@snobis.de> <http://permalink.gmane.org/gmane.emacs.orgmode/112217>
This commit is contained in:
parent
bf601016dc
commit
326894046c
|
@ -2471,17 +2471,13 @@ from the dynamic block definition."
|
|||
(level? (and (not compact?) (plist-get params :level)))
|
||||
(timestamp (plist-get params :timestamp))
|
||||
(properties (plist-get params :properties))
|
||||
(ntcol (if compact? 1
|
||||
(max 1 (or (plist-get params :tcolumns) 100))))
|
||||
(time-columns (if compact? 1
|
||||
(min maxlevel (or (plist-get params :tcolumns) 100))))
|
||||
(indent (or compact? (plist-get params :indent)))
|
||||
(formula (plist-get params :formula))
|
||||
(case-fold-search t)
|
||||
range-text total-time recalc narrow-cut-p)
|
||||
|
||||
;; Some consistency test for parameters.
|
||||
(unless (integerp ntcol)
|
||||
(setq params (plist-put params :tcolumns (setq ntcol 100))))
|
||||
|
||||
(when (and narrow (integerp narrow) link)
|
||||
;; We cannot have both integer narrow and link.
|
||||
(message
|
||||
|
@ -2545,8 +2541,7 @@ from the dynamic block definition."
|
|||
"")
|
||||
(concat (nth 4 lwords) "|") ;headline
|
||||
(concat (nth 5 lwords) "|") ;time column
|
||||
(make-string (max 0 (1- (min maxlevel (or ntcol 100))))
|
||||
?|) ;other time columns
|
||||
(make-string (max 0 (1- time-columns)) ?|) ;other time columns
|
||||
(if (eq formula '%) "%|\n" "\n"))
|
||||
|
||||
;; Insert the total time in the table
|
||||
|
@ -2563,7 +2558,7 @@ from the dynamic block definition."
|
|||
(format org-clock-total-time-cell-format
|
||||
(org-minutes-to-clocksum-string (or total-time 0))) ;time
|
||||
"|"
|
||||
(make-string (max 0 (1- (min maxlevel (or ntcol 100)))) ?|)
|
||||
(make-string (max 0 (1- time-columns)) ?|)
|
||||
(cond ((not (eq formula '%)) "")
|
||||
((or (not total-time) (= total-time 0)) "0.0|")
|
||||
(t "100.0|"))
|
||||
|
@ -2623,9 +2618,9 @@ from the dynamic block definition."
|
|||
(org-clocktable-indent-string level)
|
||||
"")
|
||||
hlc headline hlc "|" ;headline
|
||||
(make-string (1- (min ntcol level)) ?|) ;empty fields for higher levels
|
||||
hlc (org-minutes-to-clocksum-string time) hlc ; time
|
||||
(make-string (1+ (- maxlevel level)) ?|)
|
||||
;; Empty fields for higher levels.
|
||||
(make-string (max 0 (1- (min time-columns level))) ?|)
|
||||
hlc (org-minutes-to-clocksum-string time) hlc "|" ; time
|
||||
(if (eq formula '%)
|
||||
(format "%.1f |" (* 100 (/ time (float total-time))))
|
||||
"")
|
||||
|
|
Loading…
Reference in New Issue