emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Archiving in same file opens all subtrees and leaves them open
@ 2010-04-04  6:42 Tom
  2010-04-04  6:53 ` Carsten Dominik
  0 siblings, 1 reply; 3+ messages in thread
From: Tom @ 2010-04-04  6:42 UTC (permalink / raw)
  To: emacs-orgmode

I put an ARCHIVE tag to the beginning of an org file:

#+ARCHIVE: ::* archive


and archived subtrees are put correctly under the archive heading 
in the same file.

The problem is archiving opens all subtrees in the file and leaves them
open and it messes up my nicely folded file. I have to refold the trees
manually to the previous state.

Is it a bug? Why does archiving open unrelated subtrees at all
except for the "archive" tree? And if it does shouldn't it restore
the previous folding state when it's finished?


Org-mode version 6.34c

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Archiving in same file opens all subtrees and leaves them open
  2010-04-04  6:42 Archiving in same file opens all subtrees and leaves them open Tom
@ 2010-04-04  6:53 ` Carsten Dominik
  2010-04-04  8:16   ` Tom
  0 siblings, 1 reply; 3+ messages in thread
From: Carsten Dominik @ 2010-04-04  6:53 UTC (permalink / raw)
  To: Tom; +Cc: emacs-orgmode


On Apr 4, 2010, at 8:42 AM, Tom wrote:

> I put an ARCHIVE tag to the beginning of an org file:
>
> #+ARCHIVE: ::* archive
>
>
> and archived subtrees are put correctly under the archive heading
> in the same file.
>
> The problem is archiving opens all subtrees in the file and leaves  
> them
> open and it messes up my nicely folded file. I have to refold the  
> trees
> manually to the previous state.
>
> Is it a bug? Why does archiving open unrelated subtrees at all
> except for the "archive" tree?

Because normally archiving goes to a different file, where this
would not be a problem.  But you can try this patch and run with
it for a while, to see if it causes any problems.  Please report back.

diff --git a/lisp/org-archive.el b/lisp/org-archive.el
index 3889207..c0f01da 100644
--- a/lisp/org-archive.el
+++ b/lisp/org-archive.el
@@ -263,7 +263,6 @@ this heading."
  		   org-odd-levels-only
  		 tr-org-odd-levels-only)))
  	  (goto-char (point-min))
-	  (show-all)
  	  (if heading
  	      (progn
  		(if (re-search-forward



> And if it does shouldn't it restore
> the previous folding state when it's finished?

Because there is currently no way to save and restore a folding state.

- Carsten

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: Archiving in same file opens all subtrees and leaves them open
  2010-04-04  6:53 ` Carsten Dominik
@ 2010-04-04  8:16   ` Tom
  0 siblings, 0 replies; 3+ messages in thread
From: Tom @ 2010-04-04  8:16 UTC (permalink / raw)
  To: emacs-orgmode

Carsten Dominik <carsten.dominik <at> gmail.com> writes:
> 
> Because normally archiving goes to a different file, where this
> would not be a problem.  But you can try this patch and run with
> it for a while, to see if it causes any problems.  

Thanks, I'll try it.

A possible workaround (if it does cause problems) could be opening 
only the target local archive subtree, not every tree in the file. 
I have a separate top level archive tree in the file, so I wouldn't 
mind it very much if this particular tree is opened and left open if
all the other trees are left alone.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-04-04  8:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-04  6:42 Archiving in same file opens all subtrees and leaves them open Tom
2010-04-04  6:53 ` Carsten Dominik
2010-04-04  8:16   ` Tom

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).