简体   繁体   中英

How to customize the depth of org-agenda clocktable?

I'm using org-mode to note, log and clock my work. I just found out about the clocktables, and I find it extremely helpful. I want to be able to get the time from archived entries as well, however since i archive into a date tree it has a depth of 4 levels. It is easy to set up a normal clocktable, but I really want to use the one that is set up in org-agenda.

So I would like to know how can i configure the depth of the org-agenda clocktable.

I tried to set the default depth to 4 by add a custom variable to my .emacs file, but that did not help.

(setq org-clock-clocktable-default-properties '(:maxlevel 4))

This is the org-agenda clocktable, with a maxlevel of 2.

|--------------+--------------------------------------------+--------+------|
| archive.org  | *File time*                                | *3:10* |      |
|              | 2019                                       | 3:10   |      |
|              |     2019-05 mai                            |        | 3:10 |
|--------------+--------------------------------------------+--------+------|

As you see, the entries are not helpful, since it only describes the month, and not the actual entry. So if i could change the depth to 4 I would get something like this.

#+BEGIN: clocktable :maxlevel 4 :scope ("inbox.org" "archive.org") :block 2019-05-02
#+CAPTION: Clock summary at [2019-05-04 lø. 21:07], for torsdag, mai 02, 2019.
| File        | Headline                                 | Time   |      |      |      |
|-------------+------------------------------------------+--------+------+------+------|
|             | ALL *Total time*                         | *6:41* |      |      |      |
|-------------+------------------------------------------+--------+------+------+------|
| archive.org | *File time*                              | *3:10* |      |      |      |
|             | 2019                                     | 3:10   |      |      |      |
|             | \emsp 2019-05 mai                        |        | 3:10 |      |      |
|             | \emsp\emsp 2019-05-02 torsdag            |        |      | 1:00 |      |
|             | \emsp\emsp\emsp DONE Some Task           |        |      |      | 1:00 |
|             | \emsp\emsp 2019-05-03 fredag             |        |      | 0:33 |      |
|             | \emsp\emsp\emsp WAITING Another Task[0/2]|        |      |      | 0:33 |
|             | \emsp\emsp 2019-05-04 lørdag             |        |      | 1:37 |      |
|             | \emsp\emsp\emsp DONE A third Task        |        |      |      | 1:37 |
#+END:

Please note that the first table is from the org-aganda, while the second is a normal org-mode clocktable.

Thanks for any help!

Try customizing org-agenda-clockreport-parameter-plist instead. Its default value is (:link t :maxlevel 2) , so it looks like a reasonable candidate for what you want (although I have not tested that it works). Its documentations says:

Property list with parameters for the clocktable in clockreport mode. This is the display mode that shows a clock table in the daily/weekly agenda, the properties for this dynamic block can be set here. The usual clocktable parameters are allowed here, but you cannot set the properties :name, :tstart, :tend, :block, and :scope - these will be overwritten to make sure the content accurately reflects the current display in the agenda.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM