From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: Archive subtrees hierarchical (keep the parent structure) Date: Tue, 05 Aug 2014 19:23:37 +0800 Message-ID: <87iom7w56u.fsf@ericabrahamsen.net> References: <87bns012a6.fsf@voyager.localdomain> <87k36n4s54.fsf@ericabrahamsen.net> <877g2n19e1.fsf@voyager.localdomain> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34364) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEcmK-0007Ph-Ik for emacs-orgmode@gnu.org; Tue, 05 Aug 2014 07:19:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEcmB-0000U0-Rc for emacs-orgmode@gnu.org; Tue, 05 Aug 2014 07:19:40 -0400 Received: from plane.gmane.org ([80.91.229.3]:41678) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEcmB-0000Tw-LF for emacs-orgmode@gnu.org; Tue, 05 Aug 2014 07:19:31 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XEcm8-00034X-NI for emacs-orgmode@gnu.org; Tue, 05 Aug 2014 13:19:28 +0200 Received: from 111.199.148.47 ([111.199.148.47]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 05 Aug 2014 13:19:28 +0200 Received: from eric by 111.199.148.47 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 05 Aug 2014 13:19:28 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Florian Adamsky writes: > Dear Eric, > > On Tuesday, Aug 05 2014, Eric Abrahamsen wrote: > >> Thanks for this work -- I think this is a nice feature. One concern >> about the above is that, if you're archiving many FOOs, then you'll get >> a whole bunch of duplicate A/B parent structures. There are several >> places in my agenda files where I have the exact structure in your >> example, and a *whole* lot of FOOs going in and getting archived out. >> How hard would it be to look for an existing A/B parent structure in the >> archive file, and put FOO there if it's found? Not a perfect solution, >> since you might have more than one A/B, but seems like it would help in >> a majority of cases... > > if I understand you correctly, then I have already implemented that. If > I would like to archive "*** Foo", the function (fa/org-struct-subtree) > returns the parent headings as a list, e.g. ("*A " "** B"). Inside the > archive file, I search for "* A" and inside that heading I search for > "** B". If "** B" was not found, it inserts the remaining list that was > not found and does not create a new "* A" again. This means if you have > "*A " and "** B" already in your archive file it will not add a new A/B. Excellent! That's just what I meant, and it sounds like you've already taken care of it. Personally I don't mind if items get filed under the wrong parent structure (in case of duplicate parent structures), but if you wanted to do the unique id trick, that would be nice too! Thanks, Eric > A problem exists if you have the exact same structure twice in one file like > the following example: > > * A > ** B > *** FOO > > * A > ** B > *** FOO > > If you would archive both *** FOO, then the archive file would look like > this: > > * A > ** B > *** FOO > *** FOO > > In order to fix that problem we need a unique id for every heading. My > current implementation implies that at least the first heading is > unique. Then it should not be a problem. > > Best regards > -- > Florian Adamsky > http://florian.adamsky.it/