From mboxrd@z Thu Jan 1 00:00:00 1970 From: "numbchild@gmail.com" Subject: Re: Smart archiving of subtrees with parent headlines Date: Sat, 10 Feb 2018 12:27:28 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="f4030435bc60d57da90564d41106" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ekMld-0004V2-8O for emacs-orgmode@gnu.org; Fri, 09 Feb 2018 23:28:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ekMlb-0004nb-N2 for emacs-orgmode@gnu.org; Fri, 09 Feb 2018 23:28:01 -0500 Received: from mail-ot0-x22f.google.com ([2607:f8b0:4003:c0f::22f]:46092) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ekMlb-0004nD-GL for emacs-orgmode@gnu.org; Fri, 09 Feb 2018 23:27:59 -0500 Received: by mail-ot0-x22f.google.com with SMTP id f56so9620656otj.13 for ; Fri, 09 Feb 2018 20:27:59 -0800 (PST) In-Reply-To: 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" To: Mark Edgington Cc: emacs-orgmode --f4030435bc60d57da90564d41106 Content-Type: text/plain; charset="UTF-8" I like this idea. [stardiviner] GPG key ID: 47C32433 IRC(freeenode): stardiviner Twitter: @numbchild Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433 Blog: http://stardiviner.github.io/ On Sat, Feb 10, 2018 at 12:42 AM, Mark Edgington wrote: > Hello all, > > I have looked at a few threads related to the archiving of subtrees, > but haven't found anything that matches what I think would be a very > sensible archiving behavior. I already posted this as a question on > the emacs stack-exchange site > (https://emacs.stackexchange.com/questions/38530/how-to- > archive-an-org-mode-subtree-along-with-its-parent-headlines), > but realize that the mailing list is probably more likely to get some > feedback from people. So here's what I'm trying to figure out how to > do: > > Say I start with an org-file that looks like: > > #+ARCHIVE: ::* Archived > > * Foo > * Tasks > * Task1 > * Thoughts > * Thought1 > * Thought2 > > * Archived > > Now I put the point (i.e. cursor) on Thought1 and run > org-super-archive (the magical command I'm hoping to find). The result > should be: > > #+ARCHIVE: ::* Archived > > * Foo > * Tasks > * Task1 > * Thoughts > * Thought2 > > * Archived > * Foo > * Thoughts > * Thought1 > > Now I move the point to Thought2 and again run org-super-archive, > which should give me: > > #+ARCHIVE: ::* Archived > > * Foo > * Tasks > * Task1 > * Thoughts > > * Archived > * Foo > * Thoughts > * Thought1 > * Thought2 > > So the basic operation I'm seeking is the ability to archive a subtree > to whatever target location is specified with #+ARCHIVE (or > org-archive-location) where (1) the full path of the archived subtree > is mirrored beneath that target location, and (2) the subtree will be > merged into an existing path under the target if an appropriate path > already exists (e.g. a path consisting of all of the subtree's parent > headlines, regardless of the content of the bodies of these > headlines). > > As an added bonus, it would be nice if it were possible to choose > whether or not the "full path" of a subtree to be archived will > include the org-file name as the root of the path. This would be > useful in cases where you archive from multiple org-files to a single > archive.org file. > > Any thoughts on this -- has it already been done, or would it be easy to > do? > > --f4030435bc60d57da90564d41106 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I like this idea.

[stardiviner]= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <Hack this = world!>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 GPG key ID: 47C32433
IRC(freeen= ode): stardiviner =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Twitter:=C2=A0 @n= umbchild
Key fingerprint =3D 9BAA 92BC CDDD B9EF 3B36=C2=A0 CB99 B8C4 B8= E5 47C3 2433
Blog: http://stardiviner.github.io/

On Sat, Feb 10, 2018 at 12:42 AM, Mark Edgin= gton <edgimar@gmail.com> wrote:
Hello all,

I have looked at a few threads related to the archiving of subtrees,
but haven't found anything that matches what I think would be a very sensible archiving behavior.=C2=A0 I already posted this as a question on the emacs stack-exchange site
(https://emacs.stackexchange.com/questions/38530/how-to-= archive-an-org-mode-subtree-along-with-its-parent-headlines<= /a>),
but realize that the mailing list is probably more likely to get some
feedback from people.=C2=A0 So here's what I'm trying to figure out= how to
do:

Say I start with an org-file that looks like:

=C2=A0 =C2=A0 #+ARCHIVE: ::* Archived

=C2=A0 =C2=A0 * Foo
=C2=A0 =C2=A0 =C2=A0 * Tasks
=C2=A0 =C2=A0 =C2=A0 =C2=A0 * Task1
=C2=A0 =C2=A0 =C2=A0 * Thoughts
=C2=A0 =C2=A0 =C2=A0 =C2=A0 * Thought1
=C2=A0 =C2=A0 =C2=A0 =C2=A0 * Thought2

=C2=A0 =C2=A0 * Archived

Now I put the point (i.e. cursor) on Thought1 and run
org-super-archive (the magical command I'm hoping to find). The result<= br> should be:

=C2=A0 =C2=A0 #+ARCHIVE: ::* Archived

=C2=A0 =C2=A0 * Foo
=C2=A0 =C2=A0 =C2=A0 * Tasks
=C2=A0 =C2=A0 =C2=A0 =C2=A0 * Task1
=C2=A0 =C2=A0 =C2=A0 * Thoughts
=C2=A0 =C2=A0 =C2=A0 =C2=A0 * Thought2

=C2=A0 =C2=A0 * Archived
=C2=A0 =C2=A0 =C2=A0 * Foo
=C2=A0 =C2=A0 =C2=A0 =C2=A0 * Thoughts
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 * Thought1

Now I move the point to Thought2 and again run org-super-archive,
which should give me:

=C2=A0 =C2=A0 #+ARCHIVE: ::* Archived

=C2=A0 =C2=A0 * Foo
=C2=A0 =C2=A0 =C2=A0 * Tasks
=C2=A0 =C2=A0 =C2=A0 =C2=A0 * Task1
=C2=A0 =C2=A0 =C2=A0 * Thoughts

=C2=A0 =C2=A0 * Archived
=C2=A0 =C2=A0 =C2=A0 * Foo
=C2=A0 =C2=A0 =C2=A0 =C2=A0 * Thoughts
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 * Thought1
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 * Thought2

So the basic operation I'm seeking is the ability to archive a subtree<= br> to whatever target location is specified with #+ARCHIVE (or
org-archive-location) where (1) the full path of the archived subtree
is mirrored beneath that target location, and (2) the subtree will be
merged into an existing path under the target if an appropriate path
already exists (e.g. a path consisting of all of the subtree's parent headlines, regardless of the content of the bodies of these
headlines).

As an added bonus, it would be nice if it were possible to choose
whether or not the "full path" of a subtree to be archived will include the org-file name as the root of the path. This would be
useful in cases where you archive from multiple org-files to a single
archive= .org file.

Any thoughts on this -- has it already been done, or would it be easy to do= ?


--f4030435bc60d57da90564d41106--