Selaa lähdekoodia

Make sure the clocktable sees the first line of the buffer.

Org-mode still has a few operations that do not work well when the
first line of a buffer is a headline.  One was constructing the clock
table, but this one is eliminated by this patch.
Carsten Dominik 16 vuotta sitten
vanhempi
commit
382eedaab4
2 muutettua tiedostoa jossa 11 lisäystä ja 2 poistoa
  1. 5 0
      lisp/ChangeLog
  2. 6 2
      lisp/org-clock.el

+ 5 - 0
lisp/ChangeLog

@@ -1,3 +1,8 @@
+2008-11-23  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-clock.el (org-dblock-write:clocktable): Make sure the
+	clocktable sees the first line.
+
 2008-11-22  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org.el (org-open-at-point): Fix mixup about interactive and

+ 6 - 2
lisp/org-clock.el

@@ -830,7 +830,7 @@ the currently selected interval size."
 	   (block (plist-get params :block))
 	   (link (plist-get params :link))
 	   ipos time p level hlc hdl content recalc formula pcol
-	   cc beg end pos tbl tbl1 range-text rm-file-column scope-is-list)
+	   cc beg end pos tbl tbl1 range-text rm-file-column scope-is-list st)
       (setq org-clock-file-total-minutes nil)
       (when step
 	(unless (or block (and ts te))
@@ -912,7 +912,11 @@ the currently selected interval size."
 	(unless scope-is-list
 	  (org-clock-sum ts te)
 	  (goto-char (point-min))
-	  (while (setq p (next-single-property-change (point) :org-clock-minutes))
+	  (setq st t)
+	  (while (or (and (bobp) (prog1 st (setq st nil))
+			  (get-text-property (point) :org-clock-minutes)
+			  (setq p (point-min)))
+		     (setq p (next-single-property-change (point) :org-clock-minutes)))
 	    (goto-char p)
 	    (when (setq time (get-text-property p :org-clock-minutes))
 	      (save-excursion