When archiving a subtree to a different heading in the same buffer, all
headings are unfolded and the current narrowing is lost. This is easily
reproduced in a minimal instance of emacs by the following steps:

1. In an org file, create two headings "head" and "arch". Create a "child"
heading for "head".
2. Add the archive property to "head"
   :PROPERTIES:
   #+ARCHIVE: ::* arch
   :END:
3. org-narrow-to-subtree on "head".
4. org-archive-subtree on "child"
5. (This demonstrates the loss of narrowing, you can also create additional
headings with folded content to see the loss of folding.)

Both issues can be fixed by small modification to org-archive-subtree, by
wrapping the archiving edits in org-fold-core-save-visibility and
save-excursion blocks.

I am happy to submit a patch.

Reply via email to