emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Revert "Update modeline with effort and task name on re-clock-in"
@ 2010-10-03 15:21 Bernt Hansen
  2010-10-03 15:28 ` Carsten Dominik
  0 siblings, 1 reply; 6+ messages in thread
From: Bernt Hansen @ 2010-10-03 15:21 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Bernt Hansen

This reverts commit 4a4fbf1b8caa338a3a59f7b6f3f89b279615725d.

Clocking in the currently clocking task was leaving open clock entries
which is incorrect.  Updating the modeline is less important than
keeping correct clocking data.
---
This reverts a commit I made back in December.  I ran into this bug this morning
clocking in the same task quickly.  This was leaving open clocks which the 
dangling clock code tried to fix.

Regards,
Bernt

 lisp/org-clock.el |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 8979396..5b4b39c 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -959,7 +959,7 @@ the clocking selection, associated with the letter `d'."
 	;; We are interrupting the clocking of a different task.
 	;; Save a marker to this task, so that we can go back.
 	;; First check if we are trying to clock into the same task!
-	(if (save-excursion
+	(when (save-excursion
 		(unless selected-task
 		  (org-back-to-heading t))
 		(and (equal (marker-buffer org-clock-hd-marker)
@@ -970,13 +970,12 @@ the clocking selection, associated with the letter `d'."
 			(if selected-task
 			    (marker-position selected-task)
 			  (point)))))
-	    (message "Clock continues in \"%s\"" org-clock-heading)
-	  (progn
-	    (move-marker org-clock-interrupted-task
-			 (marker-position org-clock-marker)
-			 (org-clocking-buffer))
-	    (let ((org-clock-clocking-in t))
-	      (org-clock-out t)))))
+	  (message "Clock continues in \"%s\"" org-clock-heading)
+	  (throw 'abort nil))
+	(move-marker org-clock-interrupted-task
+		     (marker-position org-clock-marker)
+		     (marker-buffer org-clock-marker))
+	(org-clock-out t))
 
       (when (equal select '(16))
 	;; Mark as default clocking task
-- 
1.7.3.1.50.g1e633

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Revert "Update modeline with effort and task name on re-clock-in"
  2010-10-03 15:21 [PATCH] Revert "Update modeline with effort and task name on re-clock-in" Bernt Hansen
@ 2010-10-03 15:28 ` Carsten Dominik
  2010-10-03 15:52   ` [PATCH] Fix dangling clocks created by org-clock-out-hook clocking in again Bernt Hansen
  0 siblings, 1 reply; 6+ messages in thread
From: Carsten Dominik @ 2010-10-03 15:28 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: emacs-orgmode

Applied, thanks.

- Carsten

On Oct 3, 2010, at 5:21 PM, Bernt Hansen wrote:

> This reverts commit 4a4fbf1b8caa338a3a59f7b6f3f89b279615725d.
>
> Clocking in the currently clocking task was leaving open clock entries
> which is incorrect.  Updating the modeline is less important than
> keeping correct clocking data.
> ---
> This reverts a commit I made back in December.  I ran into this bug  
> this morning
> clocking in the same task quickly.  This was leaving open clocks  
> which the
> dangling clock code tried to fix.
>
> Regards,
> Bernt
>
> lisp/org-clock.el |   15 +++++++--------
> 1 files changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
> index 8979396..5b4b39c 100644
> --- a/lisp/org-clock.el
> +++ b/lisp/org-clock.el
> @@ -959,7 +959,7 @@ the clocking selection, associated with the  
> letter `d'."
> 	;; We are interrupting the clocking of a different task.
> 	;; Save a marker to this task, so that we can go back.
> 	;; First check if we are trying to clock into the same task!
> -	(if (save-excursion
> +	(when (save-excursion
> 		(unless selected-task
> 		  (org-back-to-heading t))
> 		(and (equal (marker-buffer org-clock-hd-marker)
> @@ -970,13 +970,12 @@ the clocking selection, associated with the  
> letter `d'."
> 			(if selected-task
> 			    (marker-position selected-task)
> 			  (point)))))
> -	    (message "Clock continues in \"%s\"" org-clock-heading)
> -	  (progn
> -	    (move-marker org-clock-interrupted-task
> -			 (marker-position org-clock-marker)
> -			 (org-clocking-buffer))
> -	    (let ((org-clock-clocking-in t))
> -	      (org-clock-out t)))))
> +	  (message "Clock continues in \"%s\"" org-clock-heading)
> +	  (throw 'abort nil))
> +	(move-marker org-clock-interrupted-task
> +		     (marker-position org-clock-marker)
> +		     (marker-buffer org-clock-marker))
> +	(org-clock-out t))
>
>       (when (equal select '(16))
> 	;; Mark as default clocking task
> -- 
> 1.7.3.1.50.g1e633
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] Fix dangling clocks created by org-clock-out-hook clocking in again
  2010-10-03 15:28 ` Carsten Dominik
@ 2010-10-03 15:52   ` Bernt Hansen
  2010-10-03 21:23     ` Carsten Dominik
  0 siblings, 1 reply; 6+ messages in thread
From: Bernt Hansen @ 2010-10-03 15:52 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Bernt Hansen

This is a fixup patch to commit
17c71a40c6d07baae2e9cac606668683ddb3759c.  The org-clock-clocking-in
variable needs to be set when we are clocking out - in case the clock
out hook clocks-in again.  This fixes a bug that creates dangling
clock entries.
---
 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 5b4b39c..c6f05fc 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -975,7 +975,8 @@ the clocking selection, associated with the letter `d'."
 	(move-marker org-clock-interrupted-task
 		     (marker-position org-clock-marker)
 		     (marker-buffer org-clock-marker))
-	(org-clock-out t))
+	(let ((org-clock-clocking-in t))
+	  (org-clock-out t)))
 
       (when (equal select '(16))
 	;; Mark as default clocking task
-- 
1.7.3.1.50.g1e633

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix dangling clocks created by org-clock-out-hook clocking in again
  2010-10-03 15:52   ` [PATCH] Fix dangling clocks created by org-clock-out-hook clocking in again Bernt Hansen
@ 2010-10-03 21:23     ` Carsten Dominik
  2010-10-03 21:53       ` Bernt Hansen
  0 siblings, 1 reply; 6+ messages in thread
From: Carsten Dominik @ 2010-10-03 21:23 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: emacs-orgmode

Hi Bernt,

I am having some problem here with the patches - could you please make  
me a new patch against the current master?

Thanks!

- Carsten

On Oct 3, 2010, at 5:52 PM, Bernt Hansen wrote:

> This is a fixup patch to commit
> 17c71a40c6d07baae2e9cac606668683ddb3759c.  The org-clock-clocking-in
> variable needs to be set when we are clocking out - in case the clock
> out hook clocks-in again.  This fixes a bug that creates dangling
> clock entries.
> ---
> 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 5b4b39c..c6f05fc 100644
> --- a/lisp/org-clock.el
> +++ b/lisp/org-clock.el
> @@ -975,7 +975,8 @@ the clocking selection, associated with the  
> letter `d'."
> 	(move-marker org-clock-interrupted-task
> 		     (marker-position org-clock-marker)
> 		     (marker-buffer org-clock-marker))
> -	(org-clock-out t))
> +	(let ((org-clock-clocking-in t))
> +	  (org-clock-out t)))
>
>       (when (equal select '(16))
> 	;; Mark as default clocking task
> -- 
> 1.7.3.1.50.g1e633
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix dangling clocks created by org-clock-out-hook clocking in again
  2010-10-03 21:23     ` Carsten Dominik
@ 2010-10-03 21:53       ` Bernt Hansen
  2010-10-04  4:19         ` Carsten Dominik
  0 siblings, 1 reply; 6+ messages in thread
From: Bernt Hansen @ 2010-10-03 21:53 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Hi Carsten,

Sure - although I think my patch is already against origin/master that
is up to date.

It's available at git://git.norang.ca/org-mode.git fixup-dangling-clock

Let me know if you want the patch reposted to the mailing list.

Regards,
Bernt


Carsten Dominik <carsten.dominik@gmail.com> writes:

> Hi Bernt,
>
> I am having some problem here with the patches - could you please make
> me a new patch against the current master?
>
> Thanks!
>
> - Carsten
>
> On Oct 3, 2010, at 5:52 PM, Bernt Hansen wrote:
>
>> This is a fixup patch to commit
>> 17c71a40c6d07baae2e9cac606668683ddb3759c.  The org-clock-clocking-in
>> variable needs to be set when we are clocking out - in case the clock
>> out hook clocks-in again.  This fixes a bug that creates dangling
>> clock entries.
>> ---
>> 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 5b4b39c..c6f05fc 100644
>> --- a/lisp/org-clock.el
>> +++ b/lisp/org-clock.el
>> @@ -975,7 +975,8 @@ the clocking selection, associated with the
>> letter `d'."
>> 	(move-marker org-clock-interrupted-task
>> 		     (marker-position org-clock-marker)
>> 		     (marker-buffer org-clock-marker))
>> -	(org-clock-out t))
>> +	(let ((org-clock-clocking-in t))
>> +	  (org-clock-out t)))
>>
>>       (when (equal select '(16))
>> 	;; Mark as default clocking task
>> --
>> 1.7.3.1.50.g1e633
>>
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Please use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix dangling clocks created by org-clock-out-hook clocking in again
  2010-10-03 21:53       ` Bernt Hansen
@ 2010-10-04  4:19         ` Carsten Dominik
  0 siblings, 0 replies; 6+ messages in thread
From: Carsten Dominik @ 2010-10-04  4:19 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: emacs-orgmode


On Oct 3, 2010, at 11:53 PM, Bernt Hansen wrote:

> Hi Carsten,
>
> Sure - although I think my patch is already against origin/master that
> is up to date.
>
> It's available at git://git.norang.ca/org-mode.git fixup-dangling- 
> clock

Ok, this worked without problems.  Thanks!

>
> Let me know if you want the patch reposted to the mailing list.

No, this is OK  now.

Kind regards

- Carsten


>
> Regards,
> Bernt
>
>
> Carsten Dominik <carsten.dominik@gmail.com> writes:
>
>> Hi Bernt,
>>
>> I am having some problem here with the patches - could you please  
>> make
>> me a new patch against the current master?
>>
>> Thanks!
>>
>> - Carsten
>>
>> On Oct 3, 2010, at 5:52 PM, Bernt Hansen wrote:
>>
>>> This is a fixup patch to commit
>>> 17c71a40c6d07baae2e9cac606668683ddb3759c.  The org-clock-clocking-in
>>> variable needs to be set when we are clocking out - in case the  
>>> clock
>>> out hook clocks-in again.  This fixes a bug that creates dangling
>>> clock entries.
>>> ---
>>> 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 5b4b39c..c6f05fc 100644
>>> --- a/lisp/org-clock.el
>>> +++ b/lisp/org-clock.el
>>> @@ -975,7 +975,8 @@ the clocking selection, associated with the
>>> letter `d'."
>>> 	(move-marker org-clock-interrupted-task
>>> 		     (marker-position org-clock-marker)
>>> 		     (marker-buffer org-clock-marker))
>>> -	(org-clock-out t))
>>> +	(let ((org-clock-clocking-in t))
>>> +	  (org-clock-out t)))
>>>
>>>      (when (equal select '(16))
>>> 	;; Mark as default clocking task
>>> --
>>> 1.7.3.1.50.g1e633
>>>
>>>
>>> _______________________________________________
>>> Emacs-orgmode mailing list
>>> Please use `Reply All' to send replies to the list.
>>> Emacs-orgmode@gnu.org
>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-10-04  4:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-03 15:21 [PATCH] Revert "Update modeline with effort and task name on re-clock-in" Bernt Hansen
2010-10-03 15:28 ` Carsten Dominik
2010-10-03 15:52   ` [PATCH] Fix dangling clocks created by org-clock-out-hook clocking in again Bernt Hansen
2010-10-03 21:23     ` Carsten Dominik
2010-10-03 21:53       ` Bernt Hansen
2010-10-04  4:19         ` Carsten Dominik

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).