On Fri, Jul 07, 2000 at 09:43:43PM +0100, Bernard Michael Hurley wrote:
> Hi,
>
> Don't use the patch for fixing the Literate Bug I submitted a few days
> ago. I have a better one! [...]
> This patch _only_ affects Literate.lyx, Literate.h and Lierate.C.
> As before you will have to re-compile Literate.lyx and install
> "listoferrors" to get it to work!
>
> Bernard
>
> PS I have changed Literate.lyx slightly from last submission. It now
> tidies up the _last_ gcc error correctly.
Hi Bernard,
I looked over your patch and it looks good. I took out your "Wish List"
section from the Literate.lyx, since I don't really think it belongs there.
Here is the slightly modified patch (attached). I also took the liberty of
creating a ChangeLog entry for this work to make it easier on whoever ends
up committing this change.
I am quoting your wish list here. You wrote:
> I am very thankful to Edmar Wienskoski Jr. for implementing
> the Literate Programming facilities in LyX. I teach programming
> and have realized that this makes LyX an incredible teaching
> tool.
Yes, it's great! Thanks, Edmar.
> This is my Wish List:
>
> Literate Programming:
> ---------------------
>
> 1. Hide <<build-script>> inside a menu item. It is not logically
> part of the Literate Program.
This is not really necessary. The "File->Build Program" menu item
does what you want.
You can also set up your lyxrc in such a way that the "Build Program" menu
item is bound to a button in the toolbar. Look at the Extended.lyx for
more info, but I do this:
\begin_toolbar
\layouts
\add layout Scrap
\add layout LaTeX
\add layout LyX-Code
\separator
\add buffer-view
\add buffer-typeset
\add build-program
[...]
Since I have my \build_command set to "build-script" (which is a one-line
shell script: ``notangle -Rbuild-script $1 | sh'') I can just press the
"Build Program" button on the toolbar.
> 2. Allow TABs to be inserted at the start of lines in the
> scrap environment. This is mainly to facilitate writing
> Makefiles.
Yes, this would be nice but difficult. I got around this problem in
one of my projects by embedding a perl script which created a Makefile.
The <<build-script>> section then did something like this:
notangle -RMakeMake.pl mysource.nw | perl > Makefile
make
It's a bit of a hack, but I actually found that writing the Makefile in
terms of this embedded perl program was useful in the expository parts
of the Literate Program.
> 3. Implement (different modes of) syntax highlighting inside
> scraps. This raises lots of issues --- e.g. how will LyX
> recognize various languages.
This too would be nice but I think it's outside the scope of LyX or
noweb.
You can pull your tangled code into any variety of syntax-sensitive
editors afterwards.
> This Program:
> -------------
>
> 1. Distinguish between gcc Errors and Warnings.
> 2. Prune duplicate Errors/Warning messages.
These are good points. Perhaps you can create another Literate.lyx
patch (after the current one is accepted).
> 3. Probe for noweb at compile time, and if it is (properly)
> installed, compile and install this program.
It's not quite that simple, but I've now done this.
You need to use lyx to --export the noweb file (which currently
requires an X server be running for lyx), then you notangle and compile
the noweb file.
Can one of you fine LyX developers go ahead and commit this attached
patch? It works quite well for me and I use the Literate Programming
stuff all the time.
You will have to ``cvs add'' the lib/build-listerrors shell script (which
is in the tiny attached gzipped tar archive).
Thanks!
---Kayvan
--
Kayvan A. Sylvan | Proud husband of | Father to my kids:
Sylvan Associates, Inc. | Laura Isabella Sylvan | Katherine Yelena
http://www.successlinks.com/kayvan | Reach your goals now! | Robin Gregory
lp-patch.gz
build-listerrors.tar.gz