Browse Source

Changed when clock auto-resolution comes into play

Clocking in on another task while an active clock is running no longer
invokes the auto-resolution logic.
John Wiegley 15 years ago
parent
commit
a0acb478a9
2 changed files with 12 additions and 3 deletions
  1. 8 0
      lisp/ChangeLog
  2. 4 3
      lisp/org-clock.el

+ 8 - 0
lisp/ChangeLog

@@ -1,5 +1,13 @@
 2009-10-22  John Wiegley  <jwiegley@gmail.com>
 
+	* org-clock.el (org-clock-auto-clock-resolution): Renamed
+	`org-clock-disable-clock-resolution', since negatives don't sound
+	good in customization variables.
+	(org-clock-in): Don't use the auto-resolution logic if the user is
+	clocking into a different task while an active clock is running.
+	This then allows the default behavior of clocking out of the open
+	task and then into the new task.
+
 	* org-habit.el (org-habit-parse-todo): Generate an error if a
 	habit has a scheduled repeat period < 1.
 	(org-habit-get-faces): Fixes to the way that colors are computed.

+ 4 - 3
lisp/org-clock.el

@@ -213,7 +213,7 @@ string as argument."
 	  (const :tag "Never" nil)
 	  (integer :tag "After N minutes")))
 
-(defcustom org-clock-disable-clock-resolution nil
+(defcustom org-clock-auto-clock-resolution t
   "When non-nil, do not resolve open clocks on clock-in."
   :group 'org-clock
   :type 'boolean)
@@ -810,9 +810,10 @@ the clocking selection, associated with the letter `d'."
 	  ts selected-task target-pos (msg-extra "")
 	  (left-over (and (not org-clock-resolving-clocks)
 			  org-clock-left-over-time)))
-      (unless (or org-clock-clocking-in
+      (unless (or interrupting
+		  org-clock-clocking-in
 		  org-clock-resolving-clocks
-		  org-clock-disable-clock-resolution)
+		  (not org-clock-auto-clock-resolution))
 	(setq org-clock-left-over-time nil)
 	(let ((org-clock-clocking-in t))
 	  (org-resolve-clocks)))	; check if any clocks are dangling