From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: [PATCH] Fix clocking on capture completion Date: Sat, 24 Jul 2010 10:20:17 -0400 Message-ID: <1279981217-14625-1-git-send-email-bernt@norang.ca> References: Return-path: Received: from [140.186.70.92] (port=45456 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OcfaY-0001RU-Kc for emacs-orgmode@gnu.org; Sat, 24 Jul 2010 10:20:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OcfaX-0001ps-3u for emacs-orgmode@gnu.org; Sat, 24 Jul 2010 10:20:30 -0400 Received: from mho-02-ewr.mailhop.org ([204.13.248.72]:60232) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OcfaX-0001pl-1y for emacs-orgmode@gnu.org; Sat, 24 Jul 2010 10:20:29 -0400 Received: from cpe000102d0fe75-cm0012256ecbde.cpe.net.cable.rogers.com ([99.239.148.180] helo=mail.norang.ca) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1OcfaW-000LI8-FB for emacs-orgmode@gnu.org; Sat, 24 Jul 2010 14:20:28 +0000 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: Bernt Hansen * lisp/org-capture.el (org-capture-finalize): Fix clock in of interrupted task during capture finalize Calling org-capture-get inside the org-with-point-at macro does not work when the current clocking task and the capture target buffer are the same. In this case the captured task would continue clocking instead of switching back to the previously clocking task. --- I think this patch fixes the issue but it should receive more testing. Please report back if this works or not. -Bernt lisp/org-capture.el | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/org-capture.el b/lisp/org-capture.el index cf09dce..2efed78 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -467,8 +467,9 @@ bypassed." (markerp (org-capture-get :interrupted-clock 'local)) (buffer-live-p (marker-buffer (org-capture-get :interrupted-clock 'local)))) - (org-with-point-at (org-capture-get :interrupted-clock 'local) - (org-clock-in)) + (let ((clock-in-task (org-capture-get :interrupted-clock 'local))) + (org-with-point-at clock-in-task + (org-clock-in))) (message "Interrupted clock has been resumed"))) (let ((beg (point-min)) -- 1.7.2