From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: [PATCH 2/2] Allow clocking in new tasks inserted before the current clocking task Date: Wed, 9 Mar 2011 20:40:21 -0500 Message-ID: <1299721221-10196-3-git-send-email-bernt@norang.ca> References: <1299721221-10196-1-git-send-email-bernt@norang.ca> Return-path: Received: from [140.186.70.92] (port=56866 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxUrq-0003kP-Ao for emacs-orgmode@gnu.org; Wed, 09 Mar 2011 20:40:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PxUrl-0004XH-AE for emacs-orgmode@gnu.org; Wed, 09 Mar 2011 20:40:42 -0500 Received: from mho-01-ewr.mailhop.org ([204.13.248.71]:10452) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PxUrl-0004XA-8E for emacs-orgmode@gnu.org; Wed, 09 Mar 2011 20:40:37 -0500 Received: from cpe000102d0fe75-cm0012256ecbde.cpe.net.cable.rogers.com ([99.239.148.180] helo=mail.norang.ca) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1PxUYh-000MjJ-Po for emacs-orgmode@gnu.org; Thu, 10 Mar 2011 01:20:55 +0000 In-Reply-To: <1299721221-10196-1-git-send-email-bernt@norang.ca> 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-clock.el (org-clock-in): Allow clocking in new tasks inserted before the current clocking task org-clock-in now checks that the name of the task you are clocking in also matches org-clock-current-task. This allows us to insert a new task in front of the current clocking task (with M-S-RET on the heading of the current clocking task) and then clock in the new task. Previously this just stated that clocking continues in the old task since the marker point now matches the new task. A side-effect of this change is that changing the current clocking task headline and clocking in again will now close the current clock and open a new entry as well as update the name of the current clocking task in the modeline. --- lisp/org-clock.el | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 693025a..cc0e51f 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -1026,7 +1026,8 @@ the clocking selection, associated with the letter `d'." (= (marker-position org-clock-hd-marker) (if selected-task (marker-position selected-task) - (point))))) + (point))) + (equal org-clock-current-task (nth 4 (org-heading-components))))) (message "Clock continues in \"%s\"" org-clock-heading) (throw 'abort nil)) (move-marker org-clock-interrupted-task -- 1.7.4.1.208.gf7c6c