emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* error in calculating percentages in clocktables
@ 2010-11-29 10:56 Joost Helberg
  2010-12-03  8:52 ` Carsten Dominik
  0 siblings, 1 reply; 4+ messages in thread
From: Joost Helberg @ 2010-11-29 10:56 UTC (permalink / raw)
  To: emacs-orgmode

ls,

I'm using clocktables and encountered an issue in calculating the
percentage in the last column. Some columns have moved 1 left in the
head-revision, but the generated formula was not changed. 
Hence the following patch. The percentages come out OK with this
patch. 

Can someone using clocktables verify that this patch is correct and
doesn't break other stuff? 

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index eb859df..0c7c73b 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -2173,9 +2173,9 @@ from the dynamic block defintion."
 	     (format
 	      "\n#+TBLFM: $%d='(org-clock-time%% @%d$%d $%d..$%d);%%.1f"
 	      pcol
-	      (+ 2 (if narrow 1 0))
-	      (+ 3 (if multifile 1 0))
-	      (+ (if multifile 1 0) 3)
+	      (+ 1 (if narrow 1 0))
+	      (+ 2 (if multifile 1 0))
+	      (+ (if multifile 1 0) 2)
 	      (1- pcol)))
 	    (setq recalc t))
 	   ((stringp formula)

regards,

Joost Helberg

-- 
Snow B.V.        http://snow.nl

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

* Re: error in calculating percentages in clocktables
  2010-11-29 10:56 error in calculating percentages in clocktables Joost Helberg
@ 2010-12-03  8:52 ` Carsten Dominik
  2010-12-03 10:13   ` Joost Helberg
  0 siblings, 1 reply; 4+ messages in thread
From: Carsten Dominik @ 2010-12-03  8:52 UTC (permalink / raw)
  To: Joost Helberg; +Cc: emacs-orgmode

Hi Joost,

thanks for this, but the new tables are complex and the patch was not  
general enough.  I have just pushed a fix which I think is correct.   
Please verify.

- Carsten

On Nov 29, 2010, at 11:56 AM, Joost Helberg wrote:

> ls,
>
> I'm using clocktables and encountered an issue in calculating the
> percentage in the last column. Some columns have moved 1 left in the
> head-revision, but the generated formula was not changed.
> Hence the following patch. The percentages come out OK with this
> patch.
>
> Can someone using clocktables verify that this patch is correct and
> doesn't break other stuff?
>
> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
> index eb859df..0c7c73b 100644
> --- a/lisp/org-clock.el
> +++ b/lisp/org-clock.el
> @@ -2173,9 +2173,9 @@ from the dynamic block defintion."
> 	     (format
> 	      "\n#+TBLFM: $%d='(org-clock-time%% @%d$%d $%d..$%d);%%.1f"
> 	      pcol
> -	      (+ 2 (if narrow 1 0))
> -	      (+ 3 (if multifile 1 0))
> -	      (+ (if multifile 1 0) 3)
> +	      (+ 1 (if narrow 1 0))
> +	      (+ 2 (if multifile 1 0))
> +	      (+ (if multifile 1 0) 2)
> 	      (1- pcol)))
> 	    (setq recalc t))
> 	   ((stringp formula)
>
> regards,
>
> Joost Helberg
>
> -- 
> Snow B.V.        http://snow.nl
>
> _______________________________________________
> 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

- Carsten

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

* Re: error in calculating percentages in clocktables
  2010-12-03  8:52 ` Carsten Dominik
@ 2010-12-03 10:13   ` Joost Helberg
  2010-12-03 10:37     ` Carsten Dominik
  0 siblings, 1 reply; 4+ messages in thread
From: Joost Helberg @ 2010-12-03 10:13 UTC (permalink / raw)
  To: carsten.dominik; +Cc: emacs-orgmode

Carsten,

your more general approach works fine for me. The pushed fix seems
allright. 

many regards,

Joost

>>>>> "Carsten" == Carsten Dominik <carsten.dominik@gmail.com> writes:
 > Subject: Re: [Orgmode] error in calculating percentages in clocktables
 > From: Carsten Dominik <carsten.dominik@gmail.com>
 > To: Joost Helberg <joost@snow.nl>
 > Cc: emacs-orgmode@gnu.org
 > Date: Fri, 3 Dec 2010 09:52:57 +0100

 > Hi Joost,

 > thanks for this, but the new tables are complex and the patch was not
 > general enough.  I have just pushed a fix which I think is correct.
 > Please verify.

 > - Carsten

 > On Nov 29, 2010, at 11:56 AM, Joost Helberg wrote:

 >> ls,
 >> 
 >> I'm using clocktables and encountered an issue in calculating the
 >> percentage in the last column. Some columns have moved 1 left in the
 >> head-revision, but the generated formula was not changed.
 >> Hence the following patch. The percentages come out OK with this
 >> patch.
 >> 
 >> Can someone using clocktables verify that this patch is correct and
 >> doesn't break other stuff?
 >> 
 >> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
 >> index eb859df..0c7c73b 100644
 >> --- a/lisp/org-clock.el
 >> +++ b/lisp/org-clock.el
 >> @@ -2173,9 +2173,9 @@ from the dynamic block defintion."
 >> (format
 >> "\n#+TBLFM: $%d='(org-clock-time%% @%d$%d $%d..$%d);%%.1f"
 >> pcol
 >> -	      (+ 2 (if narrow 1 0))
 >> -	      (+ 3 (if multifile 1 0))
 >> -	      (+ (if multifile 1 0) 3)
 >> +	      (+ 1 (if narrow 1 0))
 >> +	      (+ 2 (if multifile 1 0))
 >> +	      (+ (if multifile 1 0) 2)
 >> (1- pcol)))
 >> (setq recalc t))
 >> ((stringp formula)
 >> 
 >> regards,
 >> 
 >> Joost Helberg
 >> 
 >> -- 
 >> Snow B.V.        http://snow.nl
 >> 
 >> _______________________________________________
 >> 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

 > - Carsten




-- 
Snow B.V.        http://snow.nl

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

* Re: error in calculating percentages in clocktables
  2010-12-03 10:13   ` Joost Helberg
@ 2010-12-03 10:37     ` Carsten Dominik
  0 siblings, 0 replies; 4+ messages in thread
From: Carsten Dominik @ 2010-12-03 10:37 UTC (permalink / raw)
  To: Joost Helberg; +Cc: emacs-orgmode

Hi Joost,

thanks for your fast reaction and the testing.

- Carsten

On Dec 3, 2010, at 11:13 AM, Joost Helberg wrote:

> Carsten,
>
> your more general approach works fine for me. The pushed fix seems
> allright.
>
> many regards,
>
> Joost
>
>>>>>> "Carsten" == Carsten Dominik <carsten.dominik@gmail.com> writes:
>> Subject: Re: [Orgmode] error in calculating percentages in  
>> clocktables
>> From: Carsten Dominik <carsten.dominik@gmail.com>
>> To: Joost Helberg <joost@snow.nl>
>> Cc: emacs-orgmode@gnu.org
>> Date: Fri, 3 Dec 2010 09:52:57 +0100
>
>> Hi Joost,
>
>> thanks for this, but the new tables are complex and the patch was not
>> general enough.  I have just pushed a fix which I think is correct.
>> Please verify.
>
>> - Carsten
>
>> On Nov 29, 2010, at 11:56 AM, Joost Helberg wrote:
>
>>> ls,
>>>
>>> I'm using clocktables and encountered an issue in calculating the
>>> percentage in the last column. Some columns have moved 1 left in the
>>> head-revision, but the generated formula was not changed.
>>> Hence the following patch. The percentages come out OK with this
>>> patch.
>>>
>>> Can someone using clocktables verify that this patch is correct and
>>> doesn't break other stuff?
>>>
>>> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
>>> index eb859df..0c7c73b 100644
>>> --- a/lisp/org-clock.el
>>> +++ b/lisp/org-clock.el
>>> @@ -2173,9 +2173,9 @@ from the dynamic block defintion."
>>> (format
>>> "\n#+TBLFM: $%d='(org-clock-time%% @%d$%d $%d..$%d);%%.1f"
>>> pcol
>>> -	      (+ 2 (if narrow 1 0))
>>> -	      (+ 3 (if multifile 1 0))
>>> -	      (+ (if multifile 1 0) 3)
>>> +	      (+ 1 (if narrow 1 0))
>>> +	      (+ 2 (if multifile 1 0))
>>> +	      (+ (if multifile 1 0) 2)
>>> (1- pcol)))
>>> (setq recalc t))
>>> ((stringp formula)
>>>
>>> regards,
>>>
>>> Joost Helberg
>>>
>>> -- 
>>> Snow B.V.        http://snow.nl
>>>
>>> _______________________________________________
>>> 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
>
>> - Carsten
>
>
>
>
> -- 
> Snow B.V.        http://snow.nl

- Carsten

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

end of thread, other threads:[~2010-12-03 10:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-29 10:56 error in calculating percentages in clocktables Joost Helberg
2010-12-03  8:52 ` Carsten Dominik
2010-12-03 10:13   ` Joost Helberg
2010-12-03 10:37     ` 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).