3 .\" Manual for `runlisp' configuration files
5 .\" (c) 2020 Mark Wooding
8 .\"----- Licensing notice ---------------------------------------------------
10 .\" This file is part of Runlisp, a tool for invoking Common Lisp scripts.
12 .\" Runlisp is free software: you can redistribute it and/or modify it
13 .\" under the terms of the GNU General Public License as published by the
14 .\" Free Software Foundation; either version 3 of the License, or (at your
15 .\" option) any later version.
17 .\" Runlisp is distributed in the hope that it will be useful, but WITHOUT
18 .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 .\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 .\" You should have received a copy of the GNU General Public License
23 .\" along with Runlisp. If not, see <https://www.gnu.org/licenses/>.
40 \h'-\w'\fB\\$1\ \fP'u'\fB\\$1\ \fP\c
44 .\"--------------------------------------------------------------------------
45 .TH runlisp.conf 5 "27 August 2020" "Mark Wooding"
47 runlisp.conf \- configuration files for runlisp
49 .\"--------------------------------------------------------------------------
54 a configuration file is structured as a collection of assignments
58 gathered into named sections by header lines
61 Comments are indicated by a semicolon
63 in the leftmost column,
64 and extend to the end of the line;
65 comments and lines consisting only of whiteapace are ignored
66 and have no effect whatever.
67 Semicolons not in the first column do
70 and have no special meaning.
74 is a non-empty sequence of ASCII alphanumeric characters,
75 or the special constituent characters
102 are reserved for use by the
109 are by convention private.
113 is a line of the form
119 is a name, as defined above.
120 There may be whitespace before and after the
124 Section headers need not have distinct names.
125 Subsequent assignments are applied to the section called
127 up until the next section header, or the end of the file.
128 Assignments prior to the first section header in a file
135 begins with a line of the form
143 is a name, as defined above,
144 and it includes all subsequent
145 (non-empty, non-comment)
146 lines up to, but not including,
147 the next line which does
149 begin with whitespace or a semicolon,
150 or the end of the input file.
151 There may be space before or after the
155 assigned consists of the text of the initial line following the
161 together with the contents of the subsequent lines;
162 initial and trailing whitespace is removed from each piece,
163 and the (nonempty) pieces are joined,
164 separated by single spaces.
165 We say that a assignment
166 assigns a value to the variable
168 namely, the section in which the assignment is applied.
171 consider the following file.
179 ; this line is a comment
183 short = just a quick note
189 is assigned the value
190 .RB ` "one two ; not a comment three" ',
193 .RB ` "just a quick note" '.
195 The assignments applied to a section
196 need not have distinct variable names.
197 Only the last assignment to a particular variable name in a section is
199 the earlier assignments are simply ignored.
200 If an effective assignment assigns a value to a variable in a section,
201 we say that the variable is
203 to that value in the section.
205 .SS "Lookup and inheritance"
206 A section may have zero or more
215 sections have no parents.
218 section has one parent, namely
223 is set in a section other than one of those named above,
224 then it must consist of a space- or comma-separated list
226 which name the section's parents.
227 Currently, the parents need not be distinct,
228 though duplicates have no effect other than slowing down lookup.
229 The order in which parents are listed is not significant.
232 is not set in a section other than one of those named above,
233 then by default it has one parent, namely
236 It is currently possible to build a cyclic structure of parent links.
237 This is not recommended.
238 If lookup (explained below) detects a cycle
239 then it will report a fatal error,
240 but cycles may exist without being detected.
244 in a section as follows.
246 If there is an effective assignment
247 of a value to that variable in the section
248 then lookup finds that assignment.
250 If the section has no parents,
253 Otherwise, the variable is looked up in each of the section's parents.
254 If none of these lookups succeeds, then the lookup fails.
255 If all of the successful lookups found the
257 (not just the same value!)
258 then lookup finds that assignment.
259 Otherwise, the lookup reports an error.
261 .SS "Expansion and word-splitting"
264 relative to some home section,
265 and optionally split into words.
269 Values set by assignments in a configuration file are always expandable.
270 Values set on the command line \(en in
272 options \(en are not expandable.
275 section from environment variables (see below) are not expandable.
276 Some values set in the
278 section are expandable and some are not.
279 Applying expansion to a value that is not expandable
280 simply results in that same value, unchanged.
282 Applying expansion to an expandable value
283 produces a result string as follows.
284 The value is scanned from start to end.
288 is discarded, but the immediately following character
289 is copied to the output without further inspection.
292 .I variable substitution
304 is looked up in the section named
306 or, if omitted, in the home section.
307 If the lookup succeeds,
308 then the value is expanded,
312 and appended to the output.
313 If the lookup failed,
319 is expanded and appended to the output.
321 if the lookup fails and there is no
323 text, then an error is reported.
327 causes the expanded value to be converted to uppercase;
330 causes the expanded value to be converted to lowercase.
333 causes a backslash to be inserted before each
334 backslash or double-quote character in the expanded value,
335 so that this can be used as part of a quoted Common Lisp string.
349 is looked up in the section named
351 or, if omitted, in the home section.
352 If the lookup succeeds, then
354 is expanded and appended to the output;
357 is present, then it is expanded and appended to the output;
358 otherwise, nothing happens.
360 A dollar sign which doesn't introduce one of the forms above
361 is invalid, and a fatal error is reported.
363 Any other characters are simply appended to the output.
365 Word-splitting is similar but more complex.
366 The result is not a string, but a sequence of strings.
367 At any given point in this procedure,
368 there may be a partially constructed word,
371 Outside of quotes (see below),
372 whitespace serves to separate words.
373 When a whitespace character is encountered,
374 if there is a word under construction,
375 then it is finished and added to the output list;
376 otherwise it is simply ignored.
378 If a backslash is encountered,
379 then a word is started if there is none currently under construction,
380 and the character following the backslash is added to the current word.
382 If a single-quote character
385 then a word is started if there is none currently under construction,
388 characters up to the next single quote
389 are added to the current word.
390 This includes double quotes, dollar signs, and backslashes.
391 (Neither of the two single quotes is appended to the current word.)
393 If a double-quote character
396 then a word is started if there is none currently under construction.
397 Until the next double quote is encountered,
398 whitespace and single quotes treated literally,
399 and simply added to the current word;
400 backslashes can be used to escape characters,
401 such as double quotes,
406 \(en a variable substitution or conditional (as described above) \(en
408 and there is a current word under construction,
409 then the result of the
411 is appended to the current word.
412 If there is no current word,
413 then the variable value, or consequent or alternative text,
414 is subjected to word splitting in addition to expansion,
415 and the resulting words appended to the output sequence.
417 If any other character is encountered,
418 then a word is started if there is none currently under construction,
419 and the character is appended to the current word.
421 One case which deserves attention:
424 is encountered outside of a word,
425 so that the result is subject to word splitting,
426 then an error is reported if a new word is started
427 without there being whitespace between the closing brace of the
429 and the character which started the new word.
432 .B "bad = one ${x}two"
434 would be invalid in a word-splitting context.
436 .SS "Predefined variables in @BUILTIN"
439 Section has no parents.
440 You should not override its settings in configuration files.
441 it holds a number of variables set by the
446 The directory in which
448 auxiliary data files and scripts are located.
449 This is determined by the
451 environment variable,
457 or a value determined at compile time.
460 The preferred option prefix for ECL, either
465 the ECL developers are changing
466 the way ECL recognizes command-line options,
467 because they think that the minor aesthetic improvement
468 is worth breaking everyone's scripts.)
469 This is determined by the
474 or a value determined at compile time.
477 The directory in which
480 .B dump-runlisp-image
481 stores, custom Lisp images.
482 This is determined by the
484 environment variable,
490 or a value determined at compile time.
494 .BR dump-runlisp-image (1)
495 to the filename that a
497 command should create.
498 .RB ( dump-runlisp-image
499 will rename the image into place itself,
500 if the command completes successfully.)
504 .BR dump-runlisp-image (1)
505 to the filename of the intended output image.
515 to the name of the script being invoked.
519 .BR dump-runlisp-image (1)
520 to be the name of a directory in which a
522 command can put temporary files.
524 .SS "Other special variables"
525 In every section, the section's name
526 is automatically assigned to the variable
530 be overridden by an explicit assignment,
531 but this is not recommended.
533 .\"--------------------------------------------------------------------------
539 .BR dump-runlisp-image (1),
540 .BR query-runlisp-config (1),
544 Mark Wooding, <mdw@distorted.org.uk>
546 .\"----- That's all, folks --------------------------------------------------