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
--
Florian Adamsky
http://florian.adamsky.it/


Attachment: org-archive-subtree-hierarchical.el
Description: application/emacs-lisp

Reply via email to