emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Mark Edgington <edgimar@gmail.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Smart archiving of subtrees with parent headlines
Date: Fri, 9 Feb 2018 11:42:52 -0500	[thread overview]
Message-ID: <CAMsBe8oZkxYT9_EQkejD7TuzbdLztJYN6nvwtgz3PLi2m6Hgyg@mail.gmail.com> (raw)

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?

             reply	other threads:[~2018-02-09 16:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-09 16:42 Mark Edgington [this message]
2018-02-10  4:27 ` Smart archiving of subtrees with parent headlines numbchild
2018-02-10 14:04 ` Eric S Fraga
2018-02-12  6:54 ` Ken Mankoff
2018-02-12 21:06   ` Mark Edgington
2018-02-12 22:44   ` Mark Edgington
2018-04-26 23:34     ` Bastien
2018-05-01  0:35       ` Mark Edgington
2018-05-01  9:01         ` Bastien
2019-03-28 18:13           ` Ken Mankoff
2019-03-29  2:23             ` Mark Edgington
2019-03-29  7:18               ` Ken Mankoff
2019-04-02  7:32                 ` Ken Mankoff

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=CAMsBe8oZkxYT9_EQkejD7TuzbdLztJYN6nvwtgz3PLi2m6Hgyg@mail.gmail.com \
    --to=edgimar@gmail.com \
    --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).