Björn Kettunen <[email protected]> writes: >> I see several issues. For example, you are assuming that Org files >> always have .org extension. That's not necessarily the case. > > OK what's the best approach to this? Maybe using org-agenda-file-regexp?
Just do not use filename as a way to group file and its archives. As I suggested, you can do (org-add-archive-files (list single-file)) to get the full list. >> Also, you are trying to merge everything at the same time, from a full >> list of tables. I think you can do it much simpler. >> Instead of (setq files (org-add-archive-files files)), you can call >> org-add-archive-files one by one. That way, you will have readily >> available list of archive file name that you can group. Merging within >> the same group will be much, much easier - just sum up total file time, >> and append the data. > > I think you're right when it comes to the heuristics here, it's easier > and more reliable that way but the merging of the table data itself is > largely the same. The reason why I merged the data this way was that > the table data is gathered further below. > > The merge table data function can largely stay the > same but the determination of what has to be merged should be adjusted. I think that the function can be greatly simplified when you just need to merge individual list of tables. For (setq data ((orig time data) (archive1 time1 data1) ... (archiveN timeN dataN))) you will produce (list orig (apply #'+ (mapcar #'cadr data)) (apply #'append (mapcar #'cddr data))) -- Ihor Radchenko // yantar92, Org mode maintainer, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>
