26

I use org-mode.

When I archive some headings, they are moved to FILENAME_archive, along with the filename and OLPATH property.

From the information stored as property in the archive file I think it is possible to define a some kind of restoration operation which puts back the heading to where it originally belong.

My question is, is there any org function to achieve such task? I want this function because I now have the archived entries which I want to put back to the original file.

2
  • Have you tried broadening the refile settings to include multiple org-agenda-files and multiple depths, such that you could refile it? (setq org-refile-targets (quote ((nil :maxlevel . 9) (org-agenda-files :maxlevel . 9)))) The only thing you would need is something to remove the archived log information and restore the todo to an active status.
    – lawlist
    Feb 25, 2014 at 6:05
  • For creating elisp functions that do refiling automatically, I like to use the variable org-archive-location to set the file and the heading and follow it up with function org-archive-subtree. To do it manually, org-refile is your best bet. If you would like to post what your sample archived entry looks like, along with a sample of what you would like it to look like when it has been restored, then someone will probably be kind enough to write a sample function for you (if you find you still need some assistance).
    – lawlist
    Feb 25, 2014 at 6:28

1 Answer 1

-2

Yes, there is a built-in org-mode function to restore archived headings to their original location. This function is called "org-archive-subtree-restore", and it can be used to restore archived headings to their original location based on the filename and OLPATH property stored in the archive file.

The "org-archive-subtree-restore" function does not automatically delete the heading from the archive file. After restoring the heading to its original location, you will need to manually delete the heading from the archive file if you want to remove it.

1
  • My Emacs 28 says: No apropos matches for ‘org-archive-subtree-restore’
    – mimros
    Aug 27 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.