emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bzg@gnu.org>
To: Achim Gratz <Stromeko@nexgo.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: if we operate on a subtree, perhaps we could adjust levels
Date: Mon, 28 Jul 2014 17:05:57 +0200	[thread overview]
Message-ID: <87d2cpwg3r.fsf@bzg.ath.cx> (raw)
In-Reply-To: <87k38qwru3.fsf@Rainer.invalid> (Achim Gratz's message of "Mon,	09 Jun 2014 07:54:28 +0200")

Hi Samuel and Achim,

Achim Gratz <Stromeko@nexgo.de> 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

  reply	other threads:[~2014-07-28 17:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-27  3:44 if we operate on a subtree, perhaps we could adjust levels Samuel Wales
2014-04-11  9:07 ` Bastien
2014-04-17  9:43   ` Samuel Wales
2014-04-17 10:12     ` Bastien
2014-06-09  4:54       ` Samuel Wales
2014-06-09  5:54         ` Achim Gratz
2014-07-28 15:05           ` Bastien [this message]
2014-07-28 19:08             ` Samuel Wales
2014-07-29 14:30               ` Bastien
2014-07-29 16:03             ` Achim Gratz
2014-07-29 21:32               ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d2cpwg3r.fsf@bzg.ath.cx \
    --to=bzg@gnu.org \
    --cc=Stromeko@nexgo.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).