emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: B Grobauer <bgrobauer@googlemail.com>
Cc: Emacs-orgmode@gnu.org
Subject: Re: [PATCH] New clocktable-feature: Structure clocktable by tags rather than by hierarchy
Date: Sun, 20 Jun 2010 12:52:58 +0200	[thread overview]
Message-ID: <1ABFE7B5-846A-4366-B2AF-311C6B8E7D82@gmail.com> (raw)
In-Reply-To: <AANLkTimGqugmEPqNmXcNVnaPGWwNYOaV_Yvp_koqg5Pm@mail.gmail.com>

Hi Bernd,

wow, if this works as advertised, this is great.

Does your mechanism see inherited tags?

You need to sign the papers with the FSF for this patch.  Are
you willing to do this?

- Carsten

On Jun 20, 2010, at 12:24 PM, B Grobauer wrote:

> Hi,
>
> at work I am required to specify what I have spent my time on by  
> assigning
> clocked time to one of several projects/accounts. To do so, the
> clocktable-feature
> of org-mode already is a tremendous help, but I found that I still  
> had to
> do quite a bit of manual work, because the structure of my org-files
> does not correspond 1:1 with my projects.
>
> The attached patch allows me to tag headings with project/account  
> names
> and then have clocktable generate a table that structures the  
> clocked time
> by these project names rather than by the hierarchical layout of the
> org-files.
>
> Here is what a clock-table for the attached clocktags_test.org
> looks like without the new feature:
>
>
> | L | Headline                            |        Time |         
> |      |
> |---+-------------------------------------+-------------+-------- 
> +------|
> |   | *Total time*                        |     *17:30* |         
> |      |
> |---+-------------------------------------+-------------+-------- 
> +------|
> |   |                                     | *FILE time* | *0:00*  
> |      |
> | 1 | Todos                               |        7:00 |         
> |      |
> | 2 | DONE Unallocated Task               |             |   1:00  
> |      |
> | 2 | DONE Some Task  for Project A       |             |   1:00  
> |      |
> | 2 | DONE Some Task for Project B        |             |   1:00  
> |      |
> | 2 | DONE Another Task for Project A     |             |   1:00  
> |      |
> | 2 | DONE Antother Task for Project B    |             |   1:00  
> |      |
> | 2 | DONE Yet another Task for Project A |             |   1:00  
> |      |
> | 2 | DONE Yet antoher Task for Project B |             |   1:00  
> |      |
> | 1 | Project A                           |        7:30 |         
> |      |
> | 2 | Subproject A1                       |             |   4:30  
> |      |
> | 3 | Task 1 for Subproject A1            |             |        |  
> 2:00 |
> | 3 | Task 2 for Subproject A1            |             |        |  
> 1:00 |
> | 3 | Task 3 for Subproject A1            |             |        |  
> 1:00 |
> | 2 | Subproject A2                       |             |   3:00  
> |      |
> | 3 | Task 1 for Subproject A2            |             |        |  
> 1:00 |
> | 3 | Task 2 for Subproject A2            |             |        |  
> 1:00 |
> | 3 | Task 3 for Subproject A2            |             |        |  
> 1:00 |
> | 1 | Project B                           |        3:00 |         
> |      |
> | 2 | Task 1 for Project B                |             |   1:00  
> |      |
> | 2 | Task 2 for Project B                |             |   1:00  
> |      |
> | 2 | Task 3 for Project B                |             |   1:00  
> |      |
>
> Below is what it looks like with the new "clocktags" feature,
> assuming that
>
> - all tasks that pertain to project A have been tagged with
>  "00Project_A" (possibly using tag inheritance)
> - all tasks that pertain to project B have been tagged with
>  "01Project_B" (possibly using tag inheritance)
> - the clocktable is called with parameter ':clocktable "[0-9][0-9]"'
>  where the parameter value specifies a regular expression which
>  a tag has to match in order to be used for structuring
>  the clocktable
>
> | ClockTag    | L | Headline                              |    Time |
> |-------------+---+---------------------------------------+---------|
> |             |   | *Total time*                          | *17:30* |
> |-------------+---+---------------------------------------+---------|
> |-------------+---+---------------------------------------+---------|
> | UNALLOCATED |   | *Total*                               |  *1:00* |
> |-------------+---+---------------------------------------+---------|
> |             | 2 | DONE Unallocated Task                 |    1:00 |
> |-------------+---+---------------------------------------+---------|
> | 00Project_A |   | *Total*                               | *10:30* |
> |-------------+---+---------------------------------------+---------|
> |             | 2 | DONE Some Task  for Project A         |    1:00 |
> |             | 2 | DONE Another Task for Project A       |    1:00 |
> |             | 2 | DONE Yet another Task for Project A   |    1:00 |
> |             | 2 | Subproject A1                         |    0:30 |
> |             | 3 | Task 1 for Subproject A1              |    1:00 |
> |             | 4 | Subtask 1 of Task 1 for Subproject A1 |    1:00 |
> |             | 3 | Task 2 for Subproject A1              |    1:00 |
> |             | 3 | Task 3 for Subproject A1              |    1:00 |
> |             | 3 | Task 1 for Subproject A2              |    1:00 |
> |             | 3 | Task 2 for Subproject A2              |    1:00 |
> |             | 3 | Task 3 for Subproject A2              |    1:00 |
> |-------------+---+---------------------------------------+---------|
> | 01Project_B |   | *Total*                               |  *6:00* |
> |-------------+---+---------------------------------------+---------|
> |             | 2 | DONE Some Task for Project B          |    1:00 |
> |             | 2 | DONE Antother Task for Project B      |    1:00 |
> |             | 2 | DONE Yet antoher Task for Project B   |    1:00 |
> |             | 2 | Task 1 for Project B                  |    1:00 |
> |             | 2 | Task 2 for Project B                  |    1:00 |
> |             | 2 | Task 3 for Project B                  |    1:00 |
>
> Note that the hierarchical structure of the table is gone --
> it does not make sense here, because the times of
> children are not necessarily added to the time of the parent:
> the hierarchical structure does not have meaning anymore
> as far as clocking is concerned. Having said that, of course
> in many instances one will use the hierarchy by tagging
> a top-level name with a project/account tag and then
> use inheritance to have all children attributed to that project.
>
> The feature also works for scope=agenda and pulls
> together clocked times from all files for each "clocktag".
>
> The patch is not a small one, because I had to factor
> out the printing of the table into a function of its
> own and construct the table information as an association
> list rather than directly as a string. As a result, you now
> also have the possibility to receive the collected information
> of the clocktable as list structure when setting the parameter
> "to_alist" to a non-nil value. This may be interesting if you
> want to use the function org-dblock-write:clocktable from
> another function rather than through the inteface for
> dynamic blocks.
>
> I have tried to extensively comment the changes I made
> to org-clock.el in order to facilitate evaluation whether the
> patch is fit for inclusion into the distribution.
>
> The attached clocktags_test.org contains also examles
> for using the step parameter and the output of clocktable
> results as list structure for further use in other functions.
>
> Let me close with expressing my deep gratitude to Carsten Dominik
> and all contributors to orgmode for the fantastic orgmode
> project: I have been using org-mode for two years now and
> don't quite know how I managed without it before that...
>
> Best regards,
>
> Bernd
> < 
> clocktags_test 
> .org><clocktags.patch>_______________________________________________
> 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

  reply	other threads:[~2010-06-20 10:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-20 10:24 [PATCH] New clocktable-feature: Structure clocktable by tags rather than by hierarchy B Grobauer
2010-06-20 10:52 ` Carsten Dominik [this message]
2010-06-20 11:26   ` B Grobauer
2010-06-21  9:10     ` Giovanni Ridolfi
2013-08-26  5:18   ` [PATCH] New clocktable-feature: Structure clocktable bytags " Jeff Kowalczyk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1ABFE7B5-846A-4366-B2AF-311C6B8E7D82@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=Emacs-orgmode@gnu.org \
    --cc=bgrobauer@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).