Browse Source

Fix `org-clock-put-overlay' again.

Bastien Guerry 11 years ago
parent
commit
7c5cf02e2f
1 changed files with 6 additions and 5 deletions
  1. 6 5
      lisp/org-clock.el

+ 6 - 5
lisp/org-clock.el

@@ -1852,13 +1852,14 @@ This creates a new overlay and stores it in `org-clock-overlays', so that it
 will be easy to remove."
   (let* ((l (if level (org-get-valid-level level 0) 0))
 	 ov tx)
-    (org-move-to-column 60)
-    (unless (eolp) (skip-chars-backward "^ \t"))
-    (skip-chars-backward " \t")
-    (setq ov (make-overlay (point-at-bol) (point-at-eol))
-    	  tx (concat (buffer-substring (point-at-bol) (point))
+    (beginning-of-line)
+    (when (looking-at org-complex-heading-regexp)
+      (goto-char (match-beginning 4)))
+    (setq ov (make-overlay (point) (point-at-eol))
+    	  tx (concat (buffer-substring-no-properties (point) (match-end 4))
 		     (make-string
 		      (max 0 (- (- 60 (current-column))
+				(- (match-end 4) (match-beginning 4))
 				(length (org-get-at-bol 'line-prefix)))) ?.)
 		     (org-add-props (concat (make-string l ?*) " "
 					    (org-minutes-to-clocksum-string time)