From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Archiving in same file opens all subtrees and leaves them open Date: Sun, 4 Apr 2010 08:53:15 +0200 Message-ID: References: Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NyJhz-00067z-4n for emacs-orgmode@gnu.org; Sun, 04 Apr 2010 02:53:23 -0400 Received: from [140.186.70.92] (port=43280 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NyJhx-000661-Oq for emacs-orgmode@gnu.org; Sun, 04 Apr 2010 02:53:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NyJhu-0004ov-3U for emacs-orgmode@gnu.org; Sun, 04 Apr 2010 02:53:21 -0400 Received: from mail-ew0-f214.google.com ([209.85.219.214]:37583) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NyJht-0004od-Ql for emacs-orgmode@gnu.org; Sun, 04 Apr 2010 02:53:17 -0400 Received: by ewy6 with SMTP id 6so208316ewy.32 for ; Sat, 03 Apr 2010 23:53:16 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Tom Cc: emacs-orgmode@gnu.org 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