From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: [PATCH 1/2] Allow setting default clocking task to current clocking task Date: Wed, 9 Mar 2011 20:40:20 -0500 Message-ID: <1299721221-10196-2-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=56859 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxUro-0003hq-4S for emacs-orgmode@gnu.org; Wed, 09 Mar 2011 20:40:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PxUri-0004Wg-S8 for emacs-orgmode@gnu.org; Wed, 09 Mar 2011 20:40:39 -0500 Received: from mho-01-ewr.mailhop.org ([204.13.248.71]:10435) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PxUri-0004Wc-Py for emacs-orgmode@gnu.org; Wed, 09 Mar 2011 20:40:34 -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 1PxUYf-000Mit-BS for emacs-orgmode@gnu.org; Thu, 10 Mar 2011 01:20:53 +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): Set default clocking task when already clocking the task The default clocking task can now be set to the current clocking task. Previously this just threw an error stating the clock continues in the current clocking task. The double prefix now forces setting the default clocking task instead of forcing the user to clock out and back in again just to set the default clocking task to the current clocking task. --- lisp/org-clock.el | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index c0c6c82..693025a 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -992,6 +992,7 @@ the clocking selection, associated with the letter `d'." ts selected-task target-pos (msg-extra "") (leftover (and (not org-clock-resolving-clocks) org-clock-leftover-time))) + (when (and org-clock-auto-clock-resolution (or (not interrupting) (eq t org-clock-auto-clock-resolution)) @@ -1000,11 +1001,17 @@ the clocking selection, associated with the letter `d'." (setq org-clock-leftover-time nil) (let ((org-clock-clocking-in t)) (org-resolve-clocks))) ; check if any clocks are dangling + (when (equal select '(4)) (setq selected-task (org-clock-select-task "Clock-in on task: ")) (if selected-task (setq selected-task (copy-marker selected-task)) (error "Abort"))) + + (when (equal select '(16)) + ;; Mark as default clocking task + (org-clock-mark-default-task)) + (when interrupting ;; We are interrupting the clocking of a different task. ;; Save a marker to this task, so that we can go back. @@ -1028,10 +1035,6 @@ the clocking selection, associated with the letter `d'." (let ((org-clock-clocking-in t)) (org-clock-out t))) - (when (equal select '(16)) - ;; Mark as default clocking task - (org-clock-mark-default-task)) - ;; Clock in at which position? (setq target-pos (if (and (eobp) (not (org-on-heading-p))) -- 1.7.4.1.208.gf7c6c