-#LyX 1.6.0svn created this file. For more info see http://www.lyx.org/
-\lyxformat 341
+#LyX 2.2 created this file. For more info see http://www.lyx.org/
+\lyxformat 503
\begin_document
\begin_header
-\textclass literate-article
+\origin /systemlyxdir/examples/
+\textclass article
+\use_default_options false
+\begin_modules
+noweb
+\end_modules
+\maintain_unincluded_children false
\language english
+\language_package default
\inputencoding default
-\font_roman default
-\font_sans default
-\font_typewriter default
+\fontencoding global
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
\font_default_family default
+\use_non_tex_fonts false
\font_sc false
\font_osf false
-\font_sf_scale 100
-\font_tt_scale 100
-
+\font_sf_scale 100 100
+\font_tt_scale 100 100
\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry false
-\use_amsmath 0
-\use_esint 0
+\use_package amsmath 0
+\use_package amssymb 0
+\use_package cancel 0
+\use_package esint 0
+\use_package mathdots 1
+\use_package mathtools 0
+\use_package mhchem 1
+\use_package stackrel 0
+\use_package stmaryrd 0
+\use_package undertilde 0
\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
\use_bibtopic false
+\use_indices false
\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
-\defskip medskip
+\paragraph_indentation default
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
-\author ""
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
\end_header
\begin_body
\begin_layout Title
-LyX and Literate Programming
+\SpecialCharNoPassThru LyX
+ and Literate Programming
\begin_inset Newline newline
\end_inset
status collapsed
\begin_layout Plain Layout
-Modified by Bernard Michael Hurley bernardh@westherts.ac.uk ---- Don't blame
+Modified by Bernard Michael Hurley bernardh@westherts.ac.uk \threehyphens
+- Don't blame
Edmar for any errors that have crept in!
\end_layout
\emph on
examples/listerrors.lyx
\emph default
- which should be installed in the LyX scripts directory.
+ which should be installed in the \SpecialCharNoPassThru LyX
+ scripts directory.
\end_layout
\begin_layout Date
\end_layout
\begin_layout Standard
-After typesetting a document, LyX scans the LaTeX log file looking for errors.
+After typesetting a document, \SpecialCharNoPassThru LyX
+ scans the \SpecialCharNoPassThru LaTeX
+ log file looking for errors.
For each error found, the line number is obtained and a error box is displayed
- in the LyX screen at that position.
+ in the \SpecialCharNoPassThru LyX
+ screen at that position.
\end_layout
\begin_layout Standard
To use this feature to view compilation errors while working with literate
documents, we need a program that filters the compilation errors and puts
- them in a format suitable for LyX reading it.
+ them in a format suitable for \SpecialCharNoPassThru LyX
+ reading it.
\end_layout
The filter is required to read from standard input, parse for error messages
and copy the error messages to the standard output.
During the output process, the filter must present the error messages in
- a format that LyX can interpret, currently, the LaTeX error message format.
- Of course, nothing will prevent future LyX releases from being able to
+ a format that \SpecialCharNoPassThru LyX
+ can interpret, currently, the \SpecialCharNoPassThru LaTeX
+ error message format.
+ Of course, nothing will prevent future \SpecialCharNoPassThru LyX
+ releases from being able to
read other formats as well (like gcc error messages for example).
This mechanism is necessary to fully explore the literate programming tool's
capabilities.
Algorithm
\end_layout
-\begin_layout Scrap
-<<Function bodies>>=
-\begin_inset Newline newline
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
+
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+Function bodies
+\end_layout
+
\end_inset
int
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
main (int argc, char **argv)
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
{
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
if (argc == 2) {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
switch (argv[1][0]) {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
case 'n':
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
<<Scan input for noweb error messages>>
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
break;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
case 'x':
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
<<Scan input for xlc error messages>>
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
break;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
case 'a':
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
<<AIX system using both noweb and xlc>>
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
break;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
case 's':
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
case 'b':
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
<<Solaris and Linux systems using both noweb and gcc>>
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
break;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
case 'g':
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
default:
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
<<Scan input for gcc error messages>>
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
break;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
} else {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
<<Scan input for gcc error messages>>
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
+\end_layout
+
\end_inset
-@
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
+
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+Function prototypes
\end_layout
-\begin_layout Scrap
-<<Function prototypes>>=
-\begin_inset Newline newline
\end_inset
int main (int argc, char **argv);
-\begin_inset Newline newline
+\end_layout
+
\end_inset
-@
+
\end_layout
\begin_layout Section
input.
\end_layout
-\begin_layout Scrap
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
<<Global variables>>=
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
char buffer[200][200];
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
int last_buf_line;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
int last_err_line;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
+
+int err_line;@
+\end_layout
-int err_line;
-\begin_inset Newline newline
\end_inset
-@
+
\end_layout
\begin_layout Section
\end_layout
\begin_layout Standard
-The output format mimics the TeX error messages format.
+The output format mimics the \SpecialCharNoPassThru TeX
+ error messages format.
This function prints a number of lines residing in the global variable
\family typewriter
\begin_layout Plain Layout
This function has been slightly changed from EW's original to make scanning
- a bit easier with LaTeX::scanLogFile().
- The test has been added because LyX can crash if empty lines are allowed
- here --- I can't figure out why! --- BMH
+ a bit easier with \SpecialCharNoPassThru LaTeX
+::scanLogFile().
+ The test has been added because \SpecialCharNoPassThru LyX
+ can crash if empty lines are allowed
+ here \threehyphens
+ I can't figure out why! \threehyphens
+ BMH
\end_layout
\end_inset
\end_layout
-\begin_layout Scrap
-<<Function bodies>>=
-\begin_inset Newline newline
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
+
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+Function bodies
+\end_layout
+
\end_inset
void
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
output_error (int buf_size, int error_line, char *tool)
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
{
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
int i;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
fprintf(stdout, "! Build Error: ==> %s ==>
\backslash
n", tool);
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
fprintf(stdout, " ...
\backslash
nl.%d ...
\backslash
n", error_line);
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
for (i=0; i<buf_size; i++)
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
if (strlen(buffer[i]) != 0)
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
fprintf(stdout, "%s", buffer[i]);
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
fprintf(stdout, "
\backslash
n");
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
+\end_layout
+
\end_inset
-@
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
+
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+Function prototypes
\end_layout
-\begin_layout Scrap
-<<Function prototypes>>=
-\begin_inset Newline newline
\end_inset
void output_error (int buf_size, int error_line, char *tool);
-\begin_inset Newline newline
+\end_layout
+
\end_inset
-@
+
\end_layout
\begin_layout Section
of the file.
\end_layout
-\begin_layout Scrap
-<<Scan input for noweb error messages>>=
-\begin_inset Newline newline
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
+
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+Scan input for noweb error messages
+\end_layout
+
\end_inset
{
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
last_buf_line = 0;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
while (fgets(buffer[0], 200, stdin)) {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
if (noweb_try(0))
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
output_error(1, err_line, "noweb");
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
+\end_layout
+
\end_inset
-@
+
\end_layout
\begin_layout Standard
array.
\end_layout
-\begin_layout Scrap
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\begin_layout Plain Layout
+
<<Global variables>>=
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
char *noweb_msgs[] = {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
"couldn't open file",
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
"couldn't open temporary file",
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
"error writing temporary file",
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
"ill-formed option",
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
"unknown option",
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
"Bad format sequence",
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
"Can't open output file",
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
"Can't open temporary file",
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
"Capacity exceeded:",
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
"Ignoring unknown option -",
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
"This can't happen:",
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
"non-numeric line number in"
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
};
-\begin_inset Newline newline
-\end_inset
+\end_layout
+\begin_layout Plain Layout
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
char *noweb_msgs_mimic_gcc[] = {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
": unescaped << in documentation chunk"
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
};
-\begin_inset Newline newline
+\end_layout
+
\end_inset
-@
+
\end_layout
\begin_layout Standard
> >, or any of the above strings
\end_layout
-\begin_layout Scrap
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
<<Function bodies>>=
-\begin_inset Newline newline
-\end_inset
+\end_layout
-int
-\begin_inset Newline newline
-\end_inset
+\begin_layout Plain Layout
-noweb_try (int buf_line)
-\begin_inset Newline newline
-\end_inset
+int noweb_try (int buf_line)
+\end_layout
+
+\begin_layout Plain Layout
{
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
char *s, *t, *b;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
int i;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+\begin_layout Plain Layout
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
b = buffer[buf_line];
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
err_line = 0;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
+\end_layout
-\begin_inset Newline newline
-\end_inset
+\begin_layout Plain Layout
for (i=0; i<1; i++) {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
s = (char *)strstr (b, noweb_msgs_mimic_gcc[i]);
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
if (s != NULL) {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
t = (char *)strchr(buffer[buf_line], ':');
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
err_line = atoi(t+1);
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
t = buffer[buf_line];
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
++s;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
while (*(t++) = *(s++));
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
return 1;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
s = (char *)strstr(b, "<<");
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
if (s != NULL) {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
s = (char *)strstr(s+2, ">>");
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
if (s != NULL) {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
return 1;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
} else {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
for (i = 0; i < 12; ++i) {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
s = (char *)strstr (b, noweb_msgs[i]);
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
if (s != NULL) {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
return 1;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
return 0;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
@
\end_layout
-\begin_layout Scrap
-<<Function prototypes>>=
-\begin_inset Newline newline
\end_inset
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+<<Function prototypes>>=
+\end_layout
+
+\begin_layout Plain Layout
+
int noweb_try (int buf_line);
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
@
\end_layout
+\end_inset
+
+
+\end_layout
+
\begin_layout Standard
The xlc compiler always outputs one single line for each error found, thus
to scan the buffer for xlc error messages it is enough to exam one input
line at a time.
\end_layout
-\begin_layout Scrap
-<<Scan input for xlc error messages>>=
-\begin_inset Newline newline
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
+
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+Scan input for xlc error messages
+\end_layout
+
\end_inset
{
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
last_buf_line = 0;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
while (fgets(buffer[last_buf_line], 200, stdin)) {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
if (xlc_try(0))
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
output_error(1, err_line, "xlc");
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
+\end_layout
+
\end_inset
-@
+
\end_layout
\begin_layout Standard
The following routine tests if a given buffer line matches this criteria:
\end_layout
-\begin_layout Scrap
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\begin_layout Plain Layout
+
<<Function bodies>>=
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
int
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
xlc_try (int buf_line)
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
{
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
char *s, *t;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
t = buffer[buf_line];
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
s = t+1;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
while (*s != '"' && *s != ' ' && *s != '
\backslash
0')
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
s++;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
if (*t != '"' || *s != '"' || strncmp(s+1, ", line ", 7) != 0)
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
return 0;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
s += 8;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
err_line = atoi(s);
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
return 1;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
+\end_layout
+
\end_inset
-@
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
+
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+Function prototypes
\end_layout
-\begin_layout Scrap
-<<Function prototypes>>=
-\begin_inset Newline newline
\end_inset
int xlc_try (int buf_line);
-\begin_inset Newline newline
+\end_layout
+
\end_inset
-@
+
\end_layout
\begin_layout Standard
line number is still the same.
At the time they differ, all the accumulated lines, except the last one,
will belong to one single error message, which now can be output-ed to
- LyX.
+ \SpecialCharNoPassThru LyX
+.
\end_layout
\begin_layout Standard
.
\end_layout
-\begin_layout Scrap
-<<Scan input for gcc error messages>>=
-\begin_inset Newline newline
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
+
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+Scan input for gcc error messages
+\end_layout
+
\end_inset
{
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
char *s, *t;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
last_buf_line = 0;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
while (fgets(buffer[last_buf_line], 200, stdin)) {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
/****** Skip lines until I find an error */
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
s = (char *)strpbrk(buffer[last_buf_line], " :");
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
if (s == NULL || *s == ' ')
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
continue; /* No gcc error found here */
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
do {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
<<gcc error message criteria is to find a "...:999:" or a "...: ">>
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
/****** OK It is an error message, get line number */
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
err_line = atoi(s+1);
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
if (last_err_line == 0 || last_err_line == err_line) {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
last_err_line = err_line;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
continue; /* It's either a header or a continuation, don't output
yet */
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
- /****** Completed the scan of one error message, output it to LyX
+ /****** Completed the scan of one error message, output it to \SpecialCharNoPassThru LyX
*/
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
discharge_buffer(1);
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
break;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
} while (fgets(buffer[last_buf_line], 200, stdin));
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
/****** EOF completes the scan of whatever was being scanned */
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
discharge_buffer(0);
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
+\end_layout
+
\end_inset
-@
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
+
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+gcc error message criteria is to find a "...:999:" or a "...: "
\end_layout
-\begin_layout Scrap
-<<gcc error message criteria is to find a "...:999:" or a "...: ">>=
-\begin_inset Newline newline
\end_inset
/****** Search first ":" in the error number */
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
s = (char *)strpbrk(buffer[last_buf_line], " :");
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
last_buf_line++;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
if (s == NULL || *s == ' ')
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
<<No gcc error found here, but it might terminate the scanning of a previous
one>>
-\begin_inset Newline newline
-\end_inset
+\end_layout
-/****** Search second ":" in the error number */
-\begin_inset Newline newline
-\end_inset
+\begin_layout Plain Layout
-t = (char *)strpbrk(s+1, " :");
-\begin_inset Newline newline
-\end_inset
+/****** Search second ":" in the error number */
+\end_layout
-if (t == NULL || *t == ' ')
-\begin_inset Newline newline
-\end_inset
+\begin_layout Plain Layout
- <<No gcc error found here, but it might terminate the scanning of a previous
- one>>
-\begin_inset Newline newline
-\end_inset
+t = (char *)strpbrk(s+1, " :");if (t == NULL || *t == ' ') <<No gcc error
+ found here, but it might terminate the scanning of a previous one>>/******
+ Verify if is all digits between ":" */if (t != s+1+strspn(s+1, "0123456789"))
+ <<No gcc error found here, but it might terminate the scanning of a previous
+ one>>@
+\end_layout
-/****** Verify if is all digits between ":" */
-\begin_inset Newline newline
-\end_inset
+\begin_layout Plain Layout
-if (t != s+1+strspn(s+1, "0123456789"))
-\begin_inset Newline newline
-\end_inset
+\end_layout
- <<No gcc error found here, but it might terminate the scanning of a previous
- one>>
-\begin_inset Newline newline
-\end_inset
+\begin_layout Plain Layout
-@
\end_layout
-\begin_layout Scrap
+\begin_layout Plain Layout
+
<<No gcc error found here, but it might terminate the scanning of a previous
one>>=
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
{
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
err_line = 0;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
discharge_buffer(1);
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
continue;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
+\end_layout
+
\end_inset
-@
+
\end_layout
\begin_layout Standard
In those cases we empty the buffer completely.
\end_layout
-\begin_layout Scrap
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\begin_layout Plain Layout
+
<<Function bodies>>=
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
void
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
discharge_buffer (int save_last)
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
{
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
if (last_err_line != 0) {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
clean_gcc_messages();
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
if (save_last != 0) {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
output_error(last_buf_line-1, last_err_line, "gcc");
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
strcpy (buffer[0], buffer[last_buf_line-1]);
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
last_err_line = err_line;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
last_buf_line = 1;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
} else {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
++last_buf_line;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
clean_gcc_messages();
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
output_error(last_buf_line-1, last_err_line, "gcc");
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
last_err_line = 0;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
last_buf_line = 0;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
+\end_layout
+
\end_inset
-@
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
+
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+Function prototypes
\end_layout
-\begin_layout Scrap
-<<Function prototypes>>=
-\begin_inset Newline newline
\end_inset
void discharge_buffer (int save_last);
-\begin_inset Newline newline
+\end_layout
+
\end_inset
-@
+
\end_layout
\begin_layout Standard
\end_layout
-\begin_layout Scrap
-<<Function bodies>>=
-\begin_inset Newline newline
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
+
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+Function bodies
+\end_layout
+
\end_inset
void
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
clean_gcc_messages ()
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
{
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
int index;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
char search [30];
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
char *tail, *head;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
int search_len = sprintf(search, ".nw:%d:", last_err_line);
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
for (index = 0; index < last_buf_line-1; index++) {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
tail = (char *)strstr (buffer[index], search);
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
if ( tail == NULL) {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
tail = (char *) strstr (buffer[index], ".nw:");
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
if (tail) {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
tail += 4;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
} else {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
tail += search_len;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
if (tail != NULL) {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
head = buffer[index];
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
while (*(head++) = *(tail++));
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
+\end_layout
+
\end_inset
-@
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
+
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+Function prototypes
\end_layout
-\begin_layout Scrap
-<<Function prototypes>>=
-\begin_inset Newline newline
\end_inset
void clean_gcc_messages ();
-\begin_inset Newline newline
+\end_layout
+
\end_inset
-@
+
\end_layout
\begin_layout Standard
We just try each one for every input line:
\end_layout
-\begin_layout Scrap
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
<<AIX system using both noweb and xlc>>=
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
{
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
last_buf_line = 0;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
+
+ while (fgets(buffer[0], 200, stdin)) {
+\end_layout
+
+\begin_layout Plain Layout
+
+ if (noweb_try(0))
+\end_layout
+
+\begin_layout Plain Layout
+
+ output_error(1, err_line, "noweb");
+\end_layout
+
+\begin_layout Plain Layout
+
+ else if (xlc_try(0))
+\end_layout
+
+\begin_layout Plain Layout
+
+ output_error(1, err_line, "xlc");
+\end_layout
+
+\begin_layout Plain Layout
- while (fgets(buffer[0], 200, stdin)) {
-\begin_inset Newline newline
-\end_inset
+ }
+\end_layout
- if (noweb_try(0))
-\begin_inset Newline newline
-\end_inset
+\begin_layout Plain Layout
- output_error(1, err_line, "noweb");
-\begin_inset Newline newline
-\end_inset
+}
+\end_layout
- else if (xlc_try(0))
-\begin_inset Newline newline
-\end_inset
+\begin_layout Plain Layout
- output_error(1, err_line, "xlc");
-\begin_inset Newline newline
-\end_inset
+@
+\end_layout
- }
-\begin_inset Newline newline
\end_inset
-}
-\begin_inset Newline newline
-\end_inset
-@
\end_layout
\begin_layout Standard
the beginning of the scan:
\end_layout
-\begin_layout Scrap
-<<Solaris and Linux systems using both noweb and gcc>>=
-\begin_inset Newline newline
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
+
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+Solaris and Linux systems using both noweb and gcc
+\end_layout
+
\end_inset
{
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
char *s, *t;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
last_buf_line = 0;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
while (fgets(buffer[last_buf_line], 200, stdin)) {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
/****** Skip lines until I find an error */
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
if (last_buf_line == 0 && noweb_try(0)) {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
output_error(1, err_line, "noweb");
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
continue;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
s = (char *)strpbrk(buffer[last_buf_line], " :");
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
if (s == NULL || *s == ' ')
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
continue; /* No gcc error found here */
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
do {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
<<gcc error message criteria is to find a "...:999:" or a "...: ">>
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
/****** OK It is an error, get line number */
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
err_line = atoi(s+1);
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
if (last_err_line == 0 || last_err_line == err_line) {
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
last_err_line = err_line;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
continue; /* It's either a header or a continuation, don't output
yet */
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
-\end_inset
+\end_layout
- /****** Completed the scan of one error message, output it to LyX
+\begin_layout Plain Layout
+
+ /****** Completed the scan of one error message, output it to \SpecialCharNoPassThru LyX
*/
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
discharge_buffer(1);
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
break;
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
} while (fgets(buffer[last_buf_line], 200, stdin));
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
/****** EOF completes the scan of whatever was being scanned */
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
discharge_buffer(0);
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
}
-\begin_inset Newline newline
+\end_layout
+
\end_inset
-@
+
\end_layout
\begin_layout Section
Wrapping the code into a file
\end_layout
-\begin_layout Scrap
-<<listerrors.c>>=
-\begin_inset Newline newline
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
+
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+listerrors.c
+\end_layout
+
\end_inset
#include <stdio.h>
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
#include <strings.h>
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
<<Global variables>>
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
<<Function prototypes>>
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
<<Function bodies>>
-\begin_inset Newline newline
+\end_layout
+
\end_inset
-@
+
\end_layout
\begin_layout Standard
option to gcc.
\end_layout
-\begin_layout Scrap
-<<build-script>>=
-\begin_inset Newline newline
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
+
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+build-script
+\end_layout
+
\end_inset
#!/bin/sh
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Plain Layout
if [ -z "$NOWEB_SOURCE" ]; then NOWEB_SOURCE=Literate.nw; fi
-\begin_inset Newline newline
-\end_inset
+\end_layout
-notangle -L -Rlisterrors.c ${NOWEB_SOURCE} > listerrors.c
-\begin_inset Newline newline
-\end_inset
+\begin_layout Plain Layout
+
+if [ -z "$NOWEB_OUTPUT_DIR" ]; then NOWEB_OUTPUT_DIR=.; fi
+\end_layout
+
+\begin_layout Plain Layout
+
+notangle -L -Rlisterrors.c ${NOWEB_SOURCE} > ${NOWEB_OUTPUT_DIR}/listerrors.c
+\end_layout
+
+\begin_layout Plain Layout
gcc -g -o listerrors listerrors.c
-\begin_inset Newline newline
+\end_layout
+
\end_inset
-@
+
\end_layout
\begin_layout Standard
-This project can be tangled and compiled from LyX if you set
+This project can be tangled and compiled from \SpecialCharNoPassThru LyX
+ if you set
\family typewriter
\backslash
build_command
\family default
- to call a generic script that always extracts a scrap named
+ to call a generic script that always extracts a chunk named
\family typewriter
build-script
\family default
\begin_inset Newline newline
\end_inset
-notangle -Rbuild-script $1 | env NOWEB_SOURCE=$1 sh
+notangle -Rbuild-script $1 | env NOWEB_SOURCE=$1 NOWEB_OUTPUT_DIR=$r sh
\end_layout
\begin_layout LyX-Code