From: Samuel Wales <samologist@gmail.com>
To: Bastien <bzg@gnu.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: if we operate on a subtree, perhaps we could adjust levels
Date: Sun, 8 Jun 2014 21:54:01 -0700 [thread overview]
Message-ID: <CAJcAo8vaPV99YRkj5my18JxJjgt7wCVetK0NehCqWN7nMfj7uQ@mail.gmail.com> (raw)
In-Reply-To: <8761m81cyh.fsf@bzg.ath.cx>
hi bastien,
On 4/17/14, Bastien <bzg@gnu.org> wrote:
> Then I didn't understand what you suggested. Can you restate
> it again? Thanks,
will try.
On 3/26/14, Samuel Wales <samologist@gmail.com> wrote:
> in maint, if you encrypt with org-crypt on an entry with children, then
> demote, then decrypt, the subtree levels do not match up.
> for example, the children can end up as uncle/aunt nodes.
1 take a subtree, go to the top level of that subtree, encrypt.
2 this encrypts the entire subtree as a frozen-in-time unit.
3 when you subsequently decrypt, it decrypts the entire subtree.
4 so far so good.
5 notice the levels on the subtree. they are identical to the levels
that existed at the time of encryption. so far so good.
now do exactly as above, but between steps 2 and 3, move the encrypted entry.
move it to a very demoted place.
much more demoted than the original subtree was.
so far so good.
now decrypt.
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?
let's find out.
> maybe something like these are possibilities:
>
> 1) optionally adjust subtree levels to match the location
> of the header at time of decryption. this is similar
> to how org-yank behaves. it would have to re-encrypt
> if you encrypt, demote, decrypt, encrypt.
there is nothing special here. all it does is demote the contents
properly upon decryption. however, it is dwim.
please do c-h v org-yank-adjusted-subtrees for more information.
>
> 2) optionally put the subtree in an org source block so
> that it is no longer an active subtree (can't search
> headlines in agenda, they are not where they belong, can't export
> as part of parent, have to edit with c-c ')
this works around it. however, i don't like those drawbacks.
>
> 3) restrict the function to only operate on body text
> (can't do subtrees).
this is the hardass fix.
>
> 4) status quo (allow outline corruption at user's risk).
i don't like this one.
>
> 5) a combination.
>
> maybe there are more possibilities.
>
> comments?
i suggest 3 by default but you can enable 1.
samuel
next prev parent reply other threads:[~2014-06-09 4:54 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 [this message]
2014-06-09 5:54 ` Achim Gratz
2014-07-28 15:05 ` Bastien
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAJcAo8vaPV99YRkj5my18JxJjgt7wCVetK0NehCqWN7nMfj7uQ@mail.gmail.com \
--to=samologist@gmail.com \
--cc=bzg@gnu.org \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.