From: Jeff Heard
Subject: Question about using emacs Muse as literate programming environment
Date: 
Message-ID: <JXREg.130072$R26.81814@tornado.southeast.rr.com>
Okay, so a little background.

I'm working on my PhD and I'm finding that while I code, I tend to write 
out a lot of the meat of my papers while coding and experimenting. 
Usually, I use a separate window, but lately, I've been finding that I 
write little code and a lot of text (explaining, referencing, and 
testing brand new algorithms tends to do this to one).  So I got into 
literate programming.

Of course I use Emacs/Slime as my programming environment, but I 
discovered "muse" the other day, and it does most of what I need without 
me having to fly 13 hours to Sri Lanka to tap rubber trees by hand (I 
place writing LaTeX at about the same hassle level as going through 
airport security and flying overnight to some distant country, and if 
you missed the obtuse joke, ah well).

The only thing I now wonder is:

Has anyone written macros to do this already in elisp?  All I think 
needs to be done is to write a short elisp file that has one function to 
take a Lisp source, strip the semicolon from beginning-of-line comments, 
and either wrap <code> tags around the lisp source or drops it depending 
on the value of a parameter, then writes it to another buffer or a file.

I know there are caveats that would make it more general, for example 
maybe avoiding the assumption that all beginning of line comments are 
meant for the text (perhaps only two-semicolon beginning of line 
comments, or a semicolon-dash on the first and last lines of a 
document-destined comment).  Are there any other things I should keep in 
mind?  Does anyone else think this is a good idea?

I'm thinking the function will be

muse-publish-lisp-source

I don't suppose there's any real practical way to hybrid-ize the major 
editing modes so my muse font-lock bindings hold inside the comments?

-- Jeff
From: Debian User
Subject: Re: Question about using emacs Muse as literate programming environment
Date: 
Message-ID: <44e8b50a$0$11660$dbd4f001@news.wanadoo.nl>
It is a bit related:  have a look at pbook.el

http://www.bluetail.com/~luke/misc/emacs/pbook.pdf

It more or less automatically sets your top level comments in LaTex.



On Thu, 17 Aug 2006 04:07:05 GMT, Jeff Heard <·····@ir.iit.edu> wrote:
> Okay, so a little background.
> 
> I'm working on my PhD and I'm finding that while I code, I tend to write 
> out a lot of the meat of my papers while coding and experimenting. 
> Usually, I use a separate window, but lately, I've been finding that I 
> write little code and a lot of text (explaining, referencing, and 
> testing brand new algorithms tends to do this to one).  So I got into 
> literate programming.
> 
> Of course I use Emacs/Slime as my programming environment, but I 
> discovered "muse" the other day, and it does most of what I need without 
> me having to fly 13 hours to Sri Lanka to tap rubber trees by hand (I 
> place writing LaTeX at about the same hassle level as going through 
> airport security and flying overnight to some distant country, and if 
> you missed the obtuse joke, ah well).
> 
> The only thing I now wonder is:
> 
> Has anyone written macros to do this already in elisp?  All I think 
> needs to be done is to write a short elisp file that has one function to 
> take a Lisp source, strip the semicolon from beginning-of-line comments, 
> and either wrap <code> tags around the lisp source or drops it depending 
> on the value of a parameter, then writes it to another buffer or a file.
> 
> I know there are caveats that would make it more general, for example 
> maybe avoiding the assumption that all beginning of line comments are 
> meant for the text (perhaps only two-semicolon beginning of line 
> comments, or a semicolon-dash on the first and last lines of a 
> document-destined comment).  Are there any other things I should keep in 
> mind?  Does anyone else think this is a good idea?
> 
> I'm thinking the function will be
> 
> muse-publish-lisp-source
> 
> I don't suppose there's any real practical way to hybrid-ize the major 
> editing modes so my muse font-lock bindings hold inside the comments?
> 
> -- Jeff