From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Wales Subject: Re: if we operate on a subtree, perhaps we could adjust levels Date: Mon, 28 Jul 2014 12:08:05 -0700 Message-ID: References: <87y4zc3ss0.fsf@bzg.ath.cx> <8761m81cyh.fsf@bzg.ath.cx> <87k38qwru3.fsf@Rainer.invalid> <87d2cpwg3r.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBqHS-00028f-9U for emacs-orgmode@gnu.org; Mon, 28 Jul 2014 15:08:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XBqHI-00027t-DW for emacs-orgmode@gnu.org; Mon, 28 Jul 2014 15:08:18 -0400 In-Reply-To: <87d2cpwg3r.fsf@bzg.ath.cx> 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: Bastien Cc: Achim Gratz , emacs-orgmode@gnu.org org-yank-adjusted-subtrees? On 7/28/14, Bastien wrote: > Hi Samuel and Achim, > > Achim Gratz writes: > >> 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. > > I see now, thanks. > >>> 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. > > I tried that way, but promoting and demoting the subtrees of the > encrypted entry is tricky. > >> 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). > > By "correct level on decryption" you mean toplevel? This would really > circumvent the problem. > > Maybe we can store the level in a property on encryption and simply > throw a warning on decryption, letting the user decide whether she > wants to continue decrypting even when it may break the hierarchy. > > What do you think? > > -- > Bastien > > -- The Kafka Pandemic: http://thekafkapandemic.blogspot.com The disease DOES progress. MANY people have died from it. And ANYBODY can get it. Denmark: free Karina Hansen NOW.