summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2010-10-26 13:27:20 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2010-10-26 13:27:20 +0200
commit5801fa6c6385c56f87aea1d81b2d91beae80ff3c (patch)
treea47b3c31ba2f694791615fe6c946b4e9e70ffce8
parent29ec63acc5e9690a5dd893c04bc5bccae04094f8 (diff)
downloadorg-mode-5801fa6c6385c56f87aea1d81b2d91beae80ff3c.tar.gz
Fix bug with :maxlevel 0 in clock tables
* lisp/org-clock.el (org-dblock-write:clocktable): Pass file minutes up to caller even if no table is generated. Rainer Stengele writes: > 1. Without maxlevbel I get I get > > #+BEGIN: clocktable :scope ("file1.org" "file2") :timestamp t :tstart "<2010-05-01 Sa 00:00>" :tend "<2010-07-31 Sa 23:55>" > Clock summary at [2010-07-22 Do 09:07] > > | File | L | Timestamp | Headline | Time | | | > |-------------------+---+---------------------+----------------+----------+--------+--------| > | | | Timestamp | *Total time* | *327:51* | | | > ... > > > > with :maxlevel 0 I get > > > #+BEGIN: clocktable :maxlevel 0 :scope ("file1.org" "file2") :timestamp t :tstart "<2010-05-01 Sa 00:00>" :tend "<2010-07-31 Sa 23:55>" > Clock summary at [2010-07-22 Do 09:11] > > | File | L | Timestamp | Headline | Time | > |------+---+-----------+--------------+----------| > | | | Timestamp | *Total time* | *232:17* | > |------+---+-----------+--------------+----------| > #+END: > > > I would like to get the same results! > Is ":maxlevel 0" intended to not include the sublevel clocks?
-rw-r--r--lisp/org-clock.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index c6f05fc..0e3200f 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1839,6 +1839,7 @@ the currently selected interval size."
(setq p1 (plist-put p1 :scope 'file))
(org-prepare-agenda-buffers files)
(while (setq file (pop files))
+ (setq org-clock-file-total-minutes 0)
(with-current-buffer (find-buffer-visiting file)
(setq tbl1 (org-dblock-write:clocktable p1))
(when tbl1
@@ -1848,9 +1849,9 @@ the currently selected interval size."
(org-minutes-to-hh:mm-string
org-clock-file-total-minutes)
"*|\n"
- tbl1)) tbl)
- (setq total-time (+ (or total-time 0)
- org-clock-file-total-minutes))))))))
+ tbl1)) tbl))
+ (setq total-time (+ (or total-time 0)
+ org-clock-file-total-minutes)))))))
(goto-char pos)
(unless scope-is-list