Browse Source

org-clock: Correctly locate heading when resolving clock

* lisp/org-clock.el (org-clock-resolve-clock): Store heading location
as marker instead of raw position to ensure that org-clock-in is
called in the correct buffer.

This fixes a regression introduced by 503ede74b (org-clock: Fix
resolving clocks, 2018-12-06).
Kyle Meyer 6 years ago
parent
commit
f3584ecc3b
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lisp/org-clock.el

+ 3 - 1
lisp/org-clock.el

@@ -928,7 +928,9 @@ CLOCK is a cons cell of the form (MARKER START-TIME)."
 	;; contents, and leave point on the /next/ headline.  We store
 	;; the current entry location to be able to get back here when
 	;; we need to clock in again the previously clocked task.
-	(heading (org-with-point-at (car clock) (org-back-to-heading t))))
+	(heading (org-with-point-at (car clock)
+		   (org-back-to-heading t)
+		   (point-marker))))
     (pcase resolve-to
       (`nil
        (org-clock-clock-cancel clock)