emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Florian Adamsky <fa-orgmode@haktar.org>
To: emacs-orgmode@gnu.org
Subject: Archive subtrees hierarchical (keep the parent structure)
Date: Mon, 04 Aug 2014 21:29:53 +0200	[thread overview]
Message-ID: <87bns012a6.fsf@voyager.localdomain> (raw)

[-- Attachment #1: Type: text/plain, Size: 1345 bytes --]

Dear all,

some of my org-mode files are getting bigger and bigger. So, I decided
to use the archive feature to remove old stuff. However, I was not happy
with the current archive feature, because it just puts subtrees
unorganized in the archive file.

I was more looking for a way to archive a subtree, but keep the parent
structure. Means, if the point is at the subtree "*** FOO" in the
following example:

* A
** B
*** FOO

then it should copy the heading "* A" and "** B" to the archive file and
then move "*** Foo" to it. The only thing that I found was a feature
request from Florian Lindner [fn:1]. A couple of days I was given it a
shot and tried to implement that myself. Attached you'll find my
attempt.

It is a bit hackish, but it works for me. I think the attached code
misses two features:
  1. it only copies the parent headings with tags, but ignores
  properties and stuff like that

  2. it ignores org-reverse-note-order, but that should not be too hard
  to add.

Before I work on it again, I would like to hear your comments. Have I
implemented functions that are already in org-mode? Is this feature
useful for other people? Does it in more complicated org-mode files?

Best regards

Footnotes:

[fn:1] https://lists.gnu.org/archive/html/emacs-orgmode/2014-05/msg01214.html
--
Florian Adamsky
http://florian.adamsky.it/



[-- Attachment #2: org-archive-subtree-hierarchical.el --]
[-- Type: application/emacs-lisp, Size: 3333 bytes --]

             reply	other threads:[~2014-08-04 19:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-04 19:29 Florian Adamsky [this message]
2014-08-05  1:55 ` Archive subtrees hierarchical (keep the parent structure) Eric Abrahamsen
2014-08-05 11:08   ` Florian Adamsky
2014-08-05 11:23     ` Eric Abrahamsen
2014-08-05 12:25 ` Ken Mankoff
2014-08-05 15:32   ` Florian Adamsky
2014-08-05 16:39     ` Ken Mankoff
2014-08-05 17:46       ` Florian Adamsky
2014-08-05 18:00         ` Ken Mankoff
2014-11-04 17:03           ` Dylan Schwilk

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=87bns012a6.fsf@voyager.localdomain \
    --to=fa-orgmode@haktar.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 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).