Ihor Radchenko <[email protected]> writes:

> Björn Kettunen <[email protected]> writes:
>
>>>> Ideally I would like that similar to single file-with-archices that
>>>> archive and the their files are shown as one file.
>>>> But not sure how to do that.
>>>
>>> That's possible to do by combining the results coming from file and its
>>> archives together.
>>
>> How would you do this?
>
> (mapcar (lambda (file)
>                          (with-current-buffer (find-buffer-visiting file)
>                            (save-excursion
>                              (save-restriction
>                                (org-clock-get-table-data file params)))))
>                        files)
>
> In the above, you will need to merge table data coming from files and their 
> archives.

Looks good. I think I sort the tables and then  merge the entries next
to each other if there name without extension matches.
However the thing I haven't figure out yet is to how to merge the table
data here.

Any clues?

>> Some tests still fail I haven't figured out why.
>>
>> Here's an example test that fails:
>> Updating dynamic block ‘clocktable’ at line 1...
>> Test test-org-clock/clocktable/compact backtrace:
>
> That's because FILES variable can be '(nil) when you build a clock table
> in a buffer that is not associated with any file.

Oh that makes sense. I took the 'file argument to literal then.

> Try
>
> 1. emacs -Q
> 2. M-x org-mode
> 3. Insert
>
> * Foo
>   CLOCK: [2016-12-27 Wed 13:09]--[2016-12-28 Wed 15:09] => 26:00
>
> 4. M-x org-dynamic-block-insert-dblock RET clocktable RET

Reply via email to