sqrtminusone,
@sqrtminusone@emacs.ch avatar

I've got an question.

I have an org file for a long-running project. It's getting hard to manage because there are lots of different tasks, events, etc.

I think I want to create an "archive version" of that file, which would have the same structure but store items, say, with a timestamp older than 2 months. That would require two basic steps:

  • extracting a subtree from the original file;
  • merging the extracted subtree into the archived version.

I could implement that, but I wonder if there is any existing way for that? Or some other approach that would address the same issue?

sqrtminusone,
@sqrtminusone@emacs.ch avatar

Thanks Amy @grinn for pointing me to the necessary pieces of org-refile! It would have taken much longer to figure out otherwise.

I've made a function that org-refiles the entry at point into "archive/<file-name>.org", preserving the header structure. I only had to implement creating nonexistent headers because `org-refile' can create just one level out-of-the-box.

And another function that performs that operation on all entries found by `org-ql'.

The code is here: https://sqrtminusone.xyz/configs/emacs/#archiving-records

publicvoit,
@publicvoit@graz.social avatar

@sqrtminusone Well, there is the archive function org-archive-subtree-default.

By default, the archive file has a flat hierarchy (or no hierarchy at all).

In my config, you'll find "org-archive-subtree-hierarchically" which fixes that: https://github.com/novoid/dot-emacs/blob/master/config.org

This function is rather old and therefore, its functionality might be part of Org-mode in the meantime. I don't know.

Archiving sub-trees is till manual work to me and I like that.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • orgmode
  • DreamBathrooms
  • magazineikmin
  • thenastyranch
  • GTA5RPClips
  • Youngstown
  • mdbf
  • osvaldo12
  • slotface
  • everett
  • rosin
  • modclub
  • kavyap
  • InstantRegret
  • vwfavf
  • megavids
  • Durango
  • cisconetworking
  • ethstaker
  • cubers
  • khanakhh
  • tester
  • ngwrru68w68
  • tacticalgear
  • normalnudes
  • provamag3
  • Leos
  • anitta
  • JUstTest
  • All magazines