From 7c5cf02e2f88ccd5f90756a0cc25dc30c159fd6a Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Fri, 18 Apr 2014 21:30:12 +0200 Subject: [PATCH] Fix `org-clock-put-overlay' again. --- lisp/org-clock.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index dcea0ca7f..f2a37484c 100644 --- a/lisp/org-clock.el +++ b/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)