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 09:55:19 +0800 Message-ID: <87k36n4s54.fsf@ericabrahamsen.net> References: <87bns012a6.fsf@voyager.localdomain> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52458) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XETyX-00027l-4P for emacs-orgmode@gnu.org; Mon, 04 Aug 2014 21:55:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XETyR-0006co-Lz for emacs-orgmode@gnu.org; Mon, 04 Aug 2014 21:55:40 -0400 Received: from plane.gmane.org ([80.91.229.3]:48008) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XETyR-0006cc-Eh for emacs-orgmode@gnu.org; Mon, 04 Aug 2014 21:55:35 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XETyL-00018L-QU for emacs-orgmode@gnu.org; Tue, 05 Aug 2014 03:55:29 +0200 Received: from 114.248.28.100 ([114.248.28.100]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 05 Aug 2014 03:55:29 +0200 Received: from eric by 114.248.28.100 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 05 Aug 2014 03:55:29 +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 all, > > some of my org-mode files are getting bigger and bigger. So, I decided > to use the archive feature to remove old stuff. However, I was not happy > with the current archive feature, because it just puts subtrees > unorganized in the archive file. > > I was more looking for a way to archive a subtree, but keep the parent > structure. Means, if the point is at the subtree "*** FOO" in the > following example: > > * A > ** B > *** FOO > > then it should copy the heading "* A" and "** B" to the archive file and > then move "*** Foo" to it. The only thing that I found was a feature > request from Florian Lindner [fn:1]. A couple of days I was given it a > shot and tried to implement that myself. Attached you'll find my > attempt. 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... Thanks again, Eric > It is a bit hackish, but it works for me. I think the attached code > misses two features: > 1. it only copies the parent headings with tags, but ignores > properties and stuff like that > > 2. it ignores org-reverse-note-order, but that should not be too hard > to add. > > Before I work on it again, I would like to hear your comments. Have I > implemented functions that are already in org-mode? Is this feature > useful for other people? Does it in more complicated org-mode files? > > Best regards > > Footnotes: > > [fn:1] https://lists.gnu.org/archive/html/emacs-orgmode/2014-05/msg01214.html > -- > Florian Adamsky > http://florian.adamsky.it/