From mboxrd@z Thu Jan 1 00:00:00 1970 From: Achim Gratz Subject: Re: if we operate on a subtree, perhaps we could adjust levels Date: Mon, 09 Jun 2014 07:54:28 +0200 Message-ID: <87k38qwru3.fsf@Rainer.invalid> References: <87y4zc3ss0.fsf@bzg.ath.cx> <8761m81cyh.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58766) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WtsXg-0003MU-Ir for emacs-orgmode@gnu.org; Mon, 09 Jun 2014 01:54:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WtsXY-0008Il-Cr for emacs-orgmode@gnu.org; Mon, 09 Jun 2014 01:54:48 -0400 Received: from plane.gmane.org ([80.91.229.3]:37880) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WtsXY-0008Ih-6W for emacs-orgmode@gnu.org; Mon, 09 Jun 2014 01:54:40 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WtsXX-0003VT-AP for emacs-orgmode@gnu.org; Mon, 09 Jun 2014 07:54:39 +0200 Received: from pd9eb3b33.dip0.t-ipconnect.de ([217.235.59.51]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 09 Jun 2014 07:54:39 +0200 Received: from Stromeko by pd9eb3b33.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 09 Jun 2014 07:54:39 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Samuel Wales writes: > you will notice that the decrypted subtree is actually at a higher > level than its parent. this is a violation of org structure. > > in consequence, it can silently swallow the entire rest of the file. > > this is not desired. > > is there a way to fix it? There's two ways I can think of: 1. Record the subtree level in a property before doing the encryption and compare that to the level after decryption. If there's no match, then promote or demote as appropriate. 2. Demote the whole subtree to toplevel before encryption and promote into the correct level on decryption, (much in the same way that includes are handled). Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ Factory and User Sound Singles for Waldorf Blofeld: http://Synth.Stromeko.net/Downloads.html#WaldorfSounds