[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Recursively including files

From: gdetre
Subject: Recursively including files
Date: 18 Sep 2006 22:00:03 -0700
User-agent: G2/1.0

Dear all,

I'm a grad student, and I write a lot of notes. There's
often considerable redundancy between related topics, where
I end up wanting to have the same paragraph appear in
multiple places. If we were programming, we'd abstract the
general case as a function, and call it when necessary. In
terms of writing notes, I would like to be able to create
some markup in my notes that means "embed some other file's
contents here".

Two things make this complicated: I would
like to be able to edit an embedded file in-place and for those
changes to be saved into the embedded file, and I would like
to have embedded files be able to embed other files.

I use Emacs Muse as my markup/publishing environment, and it
works well. Michael Olson has suggested something like the
following approach:

1) when you open the file, scan for something like the
   following markup:

    <include> my_filename.muse </include>

2) place a marker at the very beginning and end of that

3) make everything between the markers invisible, and maybe

4) insert the contents of my_filename.muse between the two
   markers, maybe in a different color

5) upon saving, check inside the contents of the throwaway region
   we've defined (between the markers) for any nested
   embedded files/throwaway regions

6) for each throwaway region, save its contents to the
   appropriate file

I hope that's clear. In other words, I want to be able to
deal with a file like the following:

* Heading 1

This is my file. It includes file1.muse

<include> file1.muse </include>

Where file1.muse also includes another file. Is there any
functionality that you can think of that would help me,
beyond pairs of markers, buffer-local-variables and
invisibility/intangibility? Any suggestions would be

Thank you,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]