From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ken Mankoff Subject: Re: Archive subtrees hierarchical (keep the parent structure) Date: Tue, 05 Aug 2014 08:25:03 -0400 Message-ID: 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]:47447) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEdpb-00045e-5I for emacs-orgmode@gnu.org; Tue, 05 Aug 2014 08:27:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEdpU-0005DV-PM for emacs-orgmode@gnu.org; Tue, 05 Aug 2014 08:27:07 -0400 Received: from mail-qa0-x22f.google.com ([2607:f8b0:400d:c00::22f]:36600) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEdpU-0005DO-KP for emacs-orgmode@gnu.org; Tue, 05 Aug 2014 08:27:00 -0400 Received: by mail-qa0-f47.google.com with SMTP id i13so800089qae.20 for ; Tue, 05 Aug 2014 05:27:00 -0700 (PDT) In-reply-to: <87bns012a6.fsf@voyager.localdomain> 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: Florian Adamsky Cc: emacs-orgmode@gnu.org Hi Florian, This code looks useful and an improvement over the previous setup I was using. https://lists.gnu.org/archive/html/emacs-orgmode/2014-05/msg01218.html Can you explain what else is needed for your code to work? Currently I have #+BEGIN_SRC emacs-lisp (setq org-archive-location (concat org-directory "/archive/%s_archive::")) #+END_SRC But I don't see things archived as subtrees with just this. Do I need new/different configuration to work with your code? Thanks, -k. * On 2014-08-04 at 15:29, Florian Adamsky wrote: > 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. > > 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