emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [PATCH 2/2] Allow clocking in new tasks inserted before the current


From: Bernt Hansen
Subject: [O] [PATCH 2/2] Allow clocking in new tasks inserted before the current clocking task
Date: Wed, 9 Mar 2011 20:40:21 -0500

* 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]