emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Separate file time from its tasks times
@ 2012-03-30 13:10 Sebastien Vauban
  2012-03-30 13:24 ` Sebastien Vauban
  0 siblings, 1 reply; 9+ messages in thread
From: Sebastien Vauban @ 2012-03-30 13:10 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

2012-03-30  Sebastien Vauban  <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>

	* org-clock.el (org-clocktable-write-default): Make the sum
	appear visually correct by not mixing the total time per file
	and sub-totals.

From 148cdf141add43798e21925ca852587017f6312a Mon Sep 17 00:00:00 2001
From: Sebastien Vauban <sva-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
Date: Fri, 30 Mar 2012 15:07:01 +0200
Subject: [PATCH] Separate file time from its tasks times

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

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 7c2c2ab..b7351a7 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -2293,7 +2293,7 @@ from the dynamic block definition."
 		     properties "|") "|") "")  ;properties columns, maybe
 	       (if indent (org-clocktable-indent-string level) "") ; indentation
 	       hlc headline hlc "|"                                ; headline
-	       (make-string (min (1- ntcol) (or (- level 1))) ?|)
+	       (make-string (min (1- ntcol) (or level)) ?|)
 					; empty fields for higher levels
 	       hlc (org-minutes-to-hh:mm-string (nth 3 entry)) hlc ; time
 	       "|\n"                                               ; close line
-- 
1.7.9

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: [PATCH] Separate file time from its tasks times
  2012-03-30 13:10 [PATCH] Separate file time from its tasks times Sebastien Vauban
@ 2012-03-30 13:24 ` Sebastien Vauban
  2012-03-30 16:13   ` Bernt Hansen
                     ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Sebastien Vauban @ 2012-03-30 13:24 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hello,

"Sebastien Vauban" wrote:
> 2012-03-30  Sebastien Vauban  <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
>
> 	* org-clock.el (org-clocktable-write-default): Make the sum
> 	appear visually correct by not mixing the total time per file
> 	and sub-totals.

This can be best understood with an example...

Before:

    #+BEGIN: clocktable :maxlevel 4 :scope ("file-abc-tom.org" "file-abc-ann.org") :block 2012-02
    Clock summary at [2012-03-30 Fri 15:12], for February 2012.

    | File             | Headline         | Time  |       |
    |------------------+------------------+-------+-------|
    |                  | ALL Total time   | 19:15 |       |
    |------------------+------------------+-------+-------|
    | file-abc-tom.org | File time        | 17:15 |       |
    |                  | Task A           | 17:15 |       |
    |                  | TODO Subtask A1  |       | 17:15 |
    |------------------+------------------+-------+-------|
    | file-abc-ann.org | File time        | 2:00  |       |
    |                  | Task B           | 2:00  |       |
    |                  | TODO Subtask B2  |       |  2:00 |
     #+END:

Now:

    #+BEGIN: clocktable :maxlevel 4 :scope ("file-abc-tom.org" "file-abc-ann.org") :block 2012-02
    Clock summary at [2012-03-30 Fri 15:13], for February 2012.

    | File             | Headline         | Time  |       |       |
    |------------------+------------------+-------+-------+-------|
    |                  | ALL Total time   | 19:15 |       |       |
    |------------------+------------------+-------+-------+-------|
    | file-abc-tom.org | File time        | 17:15 |       |       |
    |                  | Task A           |       | 17:15 |       |
    |                  | TODO Subtask A1  |       |       | 17:15 |
    |------------------+------------------+-------+-------+-------|
    | file-abc-ann.org | File time        | 2:00  |       |       |
    |                  | Task B           |       |  2:00 |       |
    |                  | TODO Subtask B2  |       |       |  2:00 |
     #+END:

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: [PATCH] Separate file time from its tasks times
  2012-03-30 13:24 ` Sebastien Vauban
@ 2012-03-30 16:13   ` Bernt Hansen
  2012-03-31  8:32   ` Bastien
  2012-04-10 22:55   ` Bastien
  2 siblings, 0 replies; 9+ messages in thread
From: Bernt Hansen @ 2012-03-30 16:13 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ



Hi Seb,

I think this detail should be part of the commit message text.

Regards,
Bernt

"Sebastien Vauban"
<wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:

> Hello,
>
> "Sebastien Vauban" wrote:
>> 2012-03-30  Sebastien Vauban  <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
>>
>> 	* org-clock.el (org-clocktable-write-default): Make the sum
>> 	appear visually correct by not mixing the total time per file
>> 	and sub-totals.
>
> This can be best understood with an example...
>
> Before:
>
>     #+BEGIN: clocktable :maxlevel 4 :scope ("file-abc-tom.org" "file-abc-ann.org") :block 2012-02
>     Clock summary at [2012-03-30 Fri 15:12], for February 2012.
>
>     | File             | Headline         | Time  |       |
>     |------------------+------------------+-------+-------|
>     |                  | ALL Total time   | 19:15 |       |
>     |------------------+------------------+-------+-------|
>     | file-abc-tom.org | File time        | 17:15 |       |
>     |                  | Task A           | 17:15 |       |
>     |                  | TODO Subtask A1  |       | 17:15 |
>     |------------------+------------------+-------+-------|
>     | file-abc-ann.org | File time        | 2:00  |       |
>     |                  | Task B           | 2:00  |       |
>     |                  | TODO Subtask B2  |       |  2:00 |
>      #+END:
>
> Now:
>
>     #+BEGIN: clocktable :maxlevel 4 :scope ("file-abc-tom.org" "file-abc-ann.org") :block 2012-02
>     Clock summary at [2012-03-30 Fri 15:13], for February 2012.
>
>     | File             | Headline         | Time  |       |       |
>     |------------------+------------------+-------+-------+-------|
>     |                  | ALL Total time   | 19:15 |       |       |
>     |------------------+------------------+-------+-------+-------|
>     | file-abc-tom.org | File time        | 17:15 |       |       |
>     |                  | Task A           |       | 17:15 |       |
>     |                  | TODO Subtask A1  |       |       | 17:15 |
>     |------------------+------------------+-------+-------+-------|
>     | file-abc-ann.org | File time        | 2:00  |       |       |
>     |                  | Task B           |       |  2:00 |       |
>     |                  | TODO Subtask B2  |       |       |  2:00 |
>      #+END:
>
> Best regards,
>   Seb

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

* Re: [PATCH] Separate file time from its tasks times
  2012-03-30 13:24 ` Sebastien Vauban
  2012-03-30 16:13   ` Bernt Hansen
@ 2012-03-31  8:32   ` Bastien
  2012-04-02 10:32     ` Sebastien Vauban
  2012-04-10 22:55   ` Bastien
  2 siblings, 1 reply; 9+ messages in thread
From: Bastien @ 2012-03-31  8:32 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode

Hi Sébastien,

"Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com> writes:

> "Sebastien Vauban" wrote:
>> 2012-03-30  Sebastien Vauban  <wxhgmqzgwmuf@spammotel.com>
>>
>> 	* org-clock.el (org-clocktable-write-default): Make the sum
>> 	appear visually correct by not mixing the total time per file
>> 	and sub-totals.
>
> This can be best understood with an example...

Mhh.. I understand.  While your patch makes the display more consistent
in terms of hierarchy, I feel it doesn't help readability *that* much.

Could send other before/after examples with various clocktables configs?

I'm also interested in hearing others opinions on this.

Thanks!

-- 
 Bastien

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

* Re: [PATCH] Separate file time from its tasks times
  2012-03-31  8:32   ` Bastien
@ 2012-04-02 10:32     ` Sebastien Vauban
  0 siblings, 0 replies; 9+ messages in thread
From: Sebastien Vauban @ 2012-04-02 10:32 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Bastien,

Bastien wrote:
>>> 	* org-clock.el (org-clocktable-write-default): Make the sum
>>> 	appear visually correct by not mixing the total time per file
>>> 	and sub-totals.
>>
>> This can be best understood with an example...
>
> Mhh.. I understand.  While your patch makes the display more consistent
> in terms of hierarchy, I feel it doesn't help readability *that* much.

Not sure to understand what would really help readability from your point of
view. If we can even do better, let's do it...

What I've just noticed over the past months, is that nobody never understood
the totals of the tables I put in PDF reports -- because of the mix of
columns.

> Could send other before/after examples with various clocktables configs?

I've just sent a better example, which should display the usefulness of the
patch.

> I'm also interested in hearing others opinions on this.

Me too.

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: [PATCH] Separate file time from its tasks times
  2012-03-30 13:24 ` Sebastien Vauban
  2012-03-30 16:13   ` Bernt Hansen
  2012-03-31  8:32   ` Bastien
@ 2012-04-10 22:55   ` Bastien
  2012-04-19 19:43     ` Sebastien Vauban
  2 siblings, 1 reply; 9+ messages in thread
From: Bastien @ 2012-04-10 22:55 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode

Hi Sébastien,

"Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com> writes:

> This can be best understood with an example...

I've been thinking about this again and I made up my mind with a clearer
argument.

> Before:
>
>     #+BEGIN: clocktable :maxlevel 4 :scope ("file-abc-tom.org" "file-abc-ann.org") :block 2012-02
>     Clock summary at [2012-03-30 Fri 15:12], for February 2012.
>
>     | File             | Headline         | Time  |       |
>     |------------------+------------------+-------+-------|
>     |                  | ALL Total time   | 19:15 |       |
>     |------------------+------------------+-------+-------|
>     | file-abc-tom.org | File time        | 17:15 |       |
>     |                  | Task A           | 17:15 |       |
>     |                  | TODO Subtask A1  |       | 17:15 |
>     |------------------+------------------+-------+-------|
>     | file-abc-ann.org | File time        | 2:00  |       |
>     |                  | Task B           | 2:00  |       |
>     |                  | TODO Subtask B2  |       |  2:00 |
>      #+END:
>
> Now:
>
>     #+BEGIN: clocktable :maxlevel 4 :scope ("file-abc-tom.org" "file-abc-ann.org") :block 2012-02
>     Clock summary at [2012-03-30 Fri 15:13], for February 2012.
>
>     | File             | Headline         | Time  |       |       |
>     |------------------+------------------+-------+-------+-------|
>     |                  | ALL Total time   | 19:15 |       |       |
>     |------------------+------------------+-------+-------+-------|
>     | file-abc-tom.org | File time        | 17:15 |       |       |
>     |                  | Task A           |       | 17:15 |       |
>     |                  | TODO Subtask A1  |       |       | 17:15 |
>     |------------------+------------------+-------+-------+-------|
>     | file-abc-ann.org | File time        | 2:00  |       |       |
>     |                  | Task B           |       |  2:00 |       |
>     |                  | TODO Subtask B2  |       |       |  2:00 |
>      #+END:

If we go for the second solution, the next step would be to put the "ALL
Total time" into a different column than the "File time"... because it
can look illogical to have both in the same column, for the same reasons
it can look illogical to have a file's tasks times in the same column
than the "File time" itself.

So I'd rather stick to the current behavior, which I find more readable
in the sense that it adds less columns.  I hope you can explain this to
your collaborators :)

All best,

-- 
 Bastien

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

* Re: [PATCH] Separate file time from its tasks times
  2012-04-10 22:55   ` Bastien
@ 2012-04-19 19:43     ` Sebastien Vauban
  2012-04-20 11:10       ` Bastien
  0 siblings, 1 reply; 9+ messages in thread
From: Sebastien Vauban @ 2012-04-19 19:43 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Bastien,

Bastien wrote:
> "Sebastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:
>
>> This can be best understood with an [updated] example...
>
> I've been thinking about this again and I made up my mind with a clearer
> argument.
>
>> Before:
>>
>>   #+BEGIN: clocktable :maxlevel 4 :scope ("file-tom.org" "file-ann.org") :block 2012-04
>>   Clock summary at [2012-04-19 Thu 17:02], for April 2012.
>>
>>   | File         | Headline                      |  Time |      |
>>   |--------------+-------------------------------+-------+------|
>>   |              | ALL Total time                | 14:51 |      |
>>   |--------------+-------------------------------+-------+------|
>>   | file-tom.org | File time                     |  7:41 |      |
>>   |              | Planning                      |  3:17 |      |
>>   |              | TODO Arrange meetings         |       | 0:34 |
>>   |              | TODO List skills required     |       | 1:27 |
>>   |              | TODO Organize interviews      |       | 1:16 |
>>   |              | Reporting                     |  4:24 |      |
>>   |              | TODO Make report              |       | 1:57 |
>>   |              | TODO Present report           |       | 2:27 |
>>   |--------------+-------------------------------+-------+------|
>>   | file-ann.org | File time                     |  7:10 |      |
>>   |              | Analyzing                     |  3:47 |      |
>>   |              | TODO Analyze investment risks |       | 2:28 |
>>   |              | TODO Perform QC               |       | 1:19 |
>>   |              | Testing                       |  3:23 |      |
>>   |              | TODO Testing A side           |       | 2:17 |
>>   |              | TODO Testing B side           |       | 1:06 |
>>   #+END:
>>
>> Now:
>>
>>   #+BEGIN: clocktable :maxlevel 4 :scope ("file-tom.org" "file-ann.org") :block 2012-04
>>   Clock summary at [2012-04-19 Thu 17:00], for April 2012.
>>
>>   | File         | Headline                      | Time  |      |      |
>>   |--------------+-------------------------------+-------+------+------|
>>   |              | ALL Total time                | 14:51 |      |      |
>>   |--------------+-------------------------------+-------+------+------|
>>   | file-tom.org | File time                     | 7:41  |      |      |
>>   |              | Planning                      |       | 3:17 |      |
>>   |              | TODO Arrange meetings         |       |      | 0:34 |
>>   |              | TODO List skills required     |       |      | 1:27 |
>>   |              | TODO Organize interviews      |       |      | 1:16 |
>>   |              | Reporting                     |       | 4:24 |      |
>>   |              | TODO Make report              |       |      | 1:57 |
>>   |              | TODO Present report           |       |      | 2:27 |
>>   |--------------+-------------------------------+-------+------+------|
>>   | file-ann.org | File time                     | 7:10  |      |      |
>>   |              | Analyzing                     |       | 3:47 |      |
>>   |              | TODO Analyze investment risks |       |      | 2:28 |
>>   |              | TODO Perform QC               |       |      | 1:19 |
>>   |              | Testing                       |       | 3:23 |      |
>>   |              | TODO Testing A side           |       |      | 2:17 |
>>   |              | TODO Testing B side           |       |      | 1:06 |
>>   #+END:
>
> If we go for the second solution, the next step would be to put the "ALL
> Total time" into a different column than the "File time"...

That could be an option, yes[1].

> because it can look illogical to have both in the same column, for the same
> reasons it can look illogical to have a file's tasks times in the same
> column than the "File time" itself.

No; it is totally different. Thanks to the *separator hline*, you clearly see
the compartments (showing that times are not on the same level), and the "ALL
Total time" stands out, alone on its own.

> So I'd rather stick to the current behavior, which I find more readable in
> the sense that it adds less columns. I hope you can explain this to your
> collaborators :)

Please take a look at the following image:

  http://i.imgur.com/0dfsl.png

where you can easily compare the readability of the tables (before and after),
both in the Org buffer, and as exported PDF document.

The goal of the above is to be able to output nice bills directly from Org.
I've not yet finished but will share my output once to the point (in a couple
of days or weeks).

The above is a basecamp for reaching that goal, together with the ability to
extract the grand total time from the dynamic block[2], to be multiplied by an
hourly rate for displaying the price to be paid by the client... (not only for
collaborators!).

Best regards,
  Seb

Footnotes:

[1] I'm open to rewrite a patch with an option for separating the "ALL Total
time" from the "File times".

[2] Hence, I'm currently forced as well to disable the bold property on the
totals. See thread "Referencing a cell from a clockview table looks
impossible" (http://www.mail-archive.com/emacs-orgmode-mXXj517/zsQ@public.gmane.org/msg53315.html)
for your precious workaround.

-- 
Sebastien Vauban

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

* Re: [PATCH] Separate file time from its tasks times
  2012-04-19 19:43     ` Sebastien Vauban
@ 2012-04-20 11:10       ` Bastien
  2012-04-20 12:10         ` Francesco Pizzolante
  0 siblings, 1 reply; 9+ messages in thread
From: Bastien @ 2012-04-20 11:10 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode

Hi Sébastien,

I introduced `org-clock-file-time-cell-format' which does the same 
thing than `org-clock-total-time-cell-format' for the file time.

The original display of the clock table with the default values
for both options is consistent.  Putting the "File time" in a
different column would require putting the "Total time" in yet
another column, which IMO makes the clock table to large.

Best,

-- 
 Bastien

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

* Re: [PATCH] Separate file time from its tasks times
  2012-04-20 11:10       ` Bastien
@ 2012-04-20 12:10         ` Francesco Pizzolante
  0 siblings, 0 replies; 9+ messages in thread
From: Francesco Pizzolante @ 2012-04-20 12:10 UTC (permalink / raw)
  To: Bastien; +Cc: Sebastien Vauban, emacs-orgmode

Hi Bastien,

I'd like to give my opinion on this subject.

 > The original display of the clock table with the default values
 > for both options is consistent.  Putting the "File time" in a
 > different column would require putting the "Total time" in yet
 > another column, which IMO makes the clock table to large.

First of all, I agree with you on the fact that the current way of 
presenting the table is clear enough, at least if you keep bold 
formatting for file times.

If I understand well, Sebastien's problem is due to the fact that he has 
to remove the bold formatting in order to be able to make references to 
this table's cells (in order to use its content value in a formula).

Removing bold formatting makes things unclear as you end up with 3 
levels on the same column (grand total, file totals and first level 
heading totals). In this case, I agree with Sebastien and I would prefer 
to split the first column into 2, keeping the grand total and file 
totals on the first column.

So, in my opinion, I see 2 solutions (which are not exclusive):

1) Be able to use a cell's content value in a formula even if a special 
formatting is used in that cell; if there's already a way to achieve 
this today, please tell us...

2) Follow Sebastien's idea in order for one to choose how to display the 
first 3 levels (grand total, file times and first level heading totals): 
in either 1 or 2 or 3 columns. The default being 1 column, corresponding 
to the current behavior.

Hope this helps.

Thanks,
  Francesco

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

end of thread, other threads:[~2012-04-20 12:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-30 13:10 [PATCH] Separate file time from its tasks times Sebastien Vauban
2012-03-30 13:24 ` Sebastien Vauban
2012-03-30 16:13   ` Bernt Hansen
2012-03-31  8:32   ` Bastien
2012-04-02 10:32     ` Sebastien Vauban
2012-04-10 22:55   ` Bastien
2012-04-19 19:43     ` Sebastien Vauban
2012-04-20 11:10       ` Bastien
2012-04-20 12:10         ` Francesco Pizzolante

Code repositories for project(s) associated with this 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).