Browse Source

org-agenda.el (org-agenda-finalize): Only mark clocking task when there is one

* org-agenda.el (org-agenda-finalize): Only mark clocking task
when there is one.
Bastien Guerry 12 years ago
parent
commit
f1191b86e3
1 changed files with 4 additions and 3 deletions
  1. 4 3
      lisp/org-agenda.el

+ 4 - 3
lisp/org-agenda.el

@@ -3538,9 +3538,10 @@ generating a new one."
 	(org-agenda-dim-blocked-tasks))
       ;; We need to widen when `org-agenda-finalize' is called from
       ;; `org-agenda-change-all-lines' (e.g. in `org-agenda-clock-in')
-      (save-restriction
-      	(widen)
-	(org-agenda-mark-clocking-task))
+      (when org-clock-current-task
+	(save-restriction
+	  (widen)
+	  (org-agenda-mark-clocking-task)))
       (when org-agenda-entry-text-mode
 	(org-agenda-entry-text-hide)
 	(org-agenda-entry-text-show))