Procházet zdrojové kódy

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?
Carsten Dominik před 14 roky
rodič
revize
5801fa6c63
1 změnil soubory, kde provedl 4 přidání a 3 odebrání
  1. 4 3
      lisp/org-clock.el

+ 4 - 3
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