emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Brian van den Broek <broek@cc.umanitoba.ca>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: possible misfeature regarding multiple #+ARCHIVE lines in	a file
Date: Mon, 03 Sep 2007 13:43:59 -0400	[thread overview]
Message-ID: <46DC47DF.3060207@cc.umanitoba.ca> (raw)
In-Reply-To: <fc9e51c7b4b6db4d05c2f8c32051e22b@science.uva.nl>

Carsten Dominik said unto the world upon 09/03/2007 03:30 AM:
> 
> On Sep 2, 2007, at 0:05, Brian van den Broek wrote:
> 
>> Brian van den Broek said unto the world upon 09/01/2007 05:51 PM:

<snip me pointing to a related discussion from an earlier thread.>

>>> It seems to me that a possible fix would be to look at the end of any 
>>> subtree that is being archived, and leave behind an #+ARCHIVE line 
>>> (or perhaps uninterrupted block of #+ lines) that terminates the tree 
>>> being archived.
>>
>> Now I am curious as to if this is unworkable. Carsten, if it is, would 
>> you mind briefly sketching why? (Time permitting, of course.)
> 
> 
> Hi Brian,
> 
> In principle the solution you propose is workable of course.
> You are, in fact, not the first to think of this: for example
> the file outline.el in Emacs 22 states:
> 
> ;;; Todo:
> 
> ;; - subtree-terminators
> ;; - better handle comments before function bodies (i.e. heading)
> ;; - don't bother hiding whitespace
> 
> This is an issue in many types of files that would like to use
> outline to get a structured view on a file.  For example
> Programmers often write comments *before* a function definition.


Hi Carsten,

Thanks for taking the time to shed some light. I'm not surprised that 
the line of attack I suggested has been considered before.

> I find it hard to envision a *clean* implementation, however.
> Problems with this approach are:
> 
> - Lets say we say that comments before a headline so not belong
>   to the entry before it.   Do they belong to the entry after it?
>   If I archive the entry after it, should I move the comment then?
> 
> - What if I have a normal entry with some text in there, and I decide to
>   comment it out, just temporarily.  All of a sudden this text no longer
>   belongs to the entry, when I move the entry up or down, using
>   structure editing commands, how should I decide in a safe way what
>   comment does and what dow not belong to an entry?


OK, I start to see why you are reluctant to change the current 
behaviour. Thinking this through, I see a real risk of explosion of 
special cases and that would indeed likely get ugly.

> The current outline implementation is at least clean in the sense
> that it is totally predictable what will happen if you issue
> certain commands.
> 
> I still believe that the best work-around it to have top-level
> sections in your file, make the #+ARCHIVE lint the first line *inside*
> the section, and then have your TODO items as level 2 entries below it.
> If you are going to structure your document anyway in a way that
> requires multiple archives, why not reflect this structure also
> with top-level headlines?

Well, that's what I am doing. I've a teaching.org where each course 
for the coming year is a level 1 headline. When the year is over, I 
want to archive each course level 1 headline as a level 2 subtree of a 
level 1 headline in my teachingarchive.org. The thought is that as I 
teach say Intro to Logic over the years, each iteration of the course 
when active will be in my teaching.org. When the term is done, each 
will course tree will get archived under a Intro to Logic level 1 
heading in my archive file. So, the end result in the archive would be:

* Intro to Logic
** Intro to Logic Fall20072008
** Intro to Logic Fall20082009

* Intro to Philosophy
** Intro to Philosophy 20072008
** Intro to Philosophy 20082009

etc.


The only way I can see to do it with #+ARCHIVE lines would be to have 
my teaching.org look like

* Heading setting ARCHIVE line for following tree
* Intro to Logic Fall20072008
* Heading setting ARCHIVE line for following tree
* Intro to Philosophy 20072008
etc.

That makes for ugly clutter, IMHO. (The problem is acute in my 
intended case, as each level 1 heading needs its own ARCHIVE line.)

But, since the archiving will be done for the entire course tree and 
at most twice a year, doing it by hand would be fine.

Thanks for shedding more light and for enduring the long posts :-)

Best,

Brian vdB

  reply	other threads:[~2007-09-03 17:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-01 21:51 possible misfeature regarding multiple #+ARCHIVE lines in a file Brian van den Broek
2007-09-01 22:05 ` Brian van den Broek
2007-09-03  7:30   ` Carsten Dominik
2007-09-03 17:43     ` Brian van den Broek [this message]
2007-09-03 18:25       ` Carsten Dominik
2007-09-03 19:31         ` Brian van den Broek
2007-09-03 20:43           ` Carsten Dominik

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=46DC47DF.3060207@cc.umanitoba.ca \
    --to=broek@cc.umanitoba.ca \
    --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).