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 .\"--------------------------------------------------------------------------
52 .SS "Default configuration files"
55 programs read configuration from the following files.
58 command-line option is given, then
59 these default files are
63 .B @etcdir@/runlisp.d/*.conf
67 then all of the files within
71 in ascending lexicographical order by name.
72 This directory name can be overridden by setting the
73 .B RUNLISP_SYSCONFIG_DIR
76 .B @etcdir@/runlisp.conf
78 .B @etcdir@/runlisp.conf
79 is read; the file must exist.
80 This filename can be overridden by setting the
85 If there is a file named
87 in the user's home directory,
89 The home directory is determined to be
92 environment variable, or, if that is not set,
93 the home directory associated with the process's real uid
94 in the system password database.
95 This filename can be overridden by setting the
99 .B ~/.config/runlisp.conf
100 If there is a file named
102 in the user's XDG configuration directory,
104 The XDG configuration directory is determined to be the value of the
106 environment variable, or the
108 directory in the user's home directory
109 (as determined above).
110 This filename can be overridden by setting the
111 .B RUNLISP_USERCONFIG
112 environment variable.
113 (Note, therefore, that this variable overrides
115 of the user configuration files.)
119 a configuration file is structured as a collection of assignments
123 gathered into named sections by header lines
126 Comments are indicated by a semicolon
128 in the leftmost column,
129 and extend to the end of the line;
130 comments and lines consisting only of whiteapace are ignored
131 and have no effect whatever.
132 Semicolons not in the first column do
135 and have no special meaning.
139 is a non-empty sequence of ASCII alphanumeric characters,
140 or the special constituent characters
158 .RB ` *organa-solo* '
167 are reserved for use by the
174 are by convention private.
178 is a line of the form
184 is a name, as defined above.
185 There may be whitespace before and after the
189 Section headers need not have distinct names.
190 Subsequent assignments are applied to the section called
192 up until the next section header, or the end of the file.
193 Assignments prior to the first section header in a file
200 begins with a line of the form
208 is a name, as defined above,
209 and it includes all subsequent
210 (non-empty, non-comment)
211 lines up to, but not including,
212 the next line which does
214 begin with whitespace or a semicolon,
215 or the end of the input file.
216 There may be space before or after the
220 assigned consists of the text of the initial line following the
226 together with the contents of the subsequent lines;
227 initial and trailing whitespace is removed from each piece,
228 and the (nonempty) pieces are joined,
229 separated by single spaces.
230 We say that an assignment
231 assigns a value to the variable
233 namely, the section in which the assignment is applied.
236 consider the following file.
244 ; this line is a comment
248 short = just a quick note
254 is assigned the value
255 .RB ` "one two ; not a comment three" ',
259 .RB ` "just a quick note" '.
261 The assignments applied to a section
262 need not have distinct variable names.
263 Only the last assignment to a particular variable name in a section is
265 the earlier assignments are simply ignored.
266 If an effective assignment assigns a value to a variable in a section,
267 we say that the variable is
269 to that value in the section.
271 .SS "Lookup and inheritance"
272 A section may have zero or more
280 sections have no parents.
283 section has one parent, namely
288 is set in a section other than one of those named above,
289 then it must consist of a space- and/or comma-separated list
291 which name the section's parents.
292 Currently, the parents need not be distinct,
293 though duplicates have no effect other than slowing down lookup.
294 The order in which parents are listed is not significant.
297 is not set in a section other than one of those named above,
298 then by default it has one parent, namely
301 It is currently possible to build a cyclic structure of parent links.
302 This is not recommended.
303 If lookup (explained below) detects a cycle
304 then it will report a fatal error,
305 but cycles may exist without being detected.
309 in a section as follows.
311 If there is an effective assignment
312 of a value to that variable in the section
313 then lookup finds that assignment.
315 If the section has no parents,
318 Otherwise, the variable is looked up in each of the section's parents.
319 If none of these lookups succeeds, then the lookup fails.
320 If all of the successful lookups found the
322 (not just the same value!)\&
323 then lookup finds that assignment.
324 Otherwise, the lookup reports an error.
326 .SS "Expansion and word-splitting"
329 relative to some home section,
330 and optionally split into words.
334 Values set by assignments in a configuration file are always expandable.
335 Values set on the command line \(en in
337 options \(en are not expandable.
340 section from environment variables (see below) are not expandable.
341 Some values set in the
343 section are expandable and some are not.
344 Applying expansion to a value that is not expandable
345 simply results in that same value, unchanged.
347 Applying expansion to an expandable value
348 produces a result string as follows.
349 The value is scanned from start to end.
353 is discarded, but the immediately following character
354 is copied to the output without further inspection.
357 .I variable substitution
369 is looked up in the section named
371 or, if omitted, in the home section.
372 If the lookup succeeds,
373 then the value is expanded,
377 and appended to the output.
378 If the lookup failed,
384 is expanded and appended to the output.
386 if the lookup fails and there is no
388 text, then an error is reported.
392 causes the expanded value to be converted to uppercase;
395 causes the expanded value to be converted to lowercase.
398 causes a backslash to be inserted before each
399 backslash or double-quote character in the expanded value,
400 so that this can be used as part of a quoted Common Lisp string.
414 is looked up in the section named
416 or, if omitted, in the home section.
417 If the lookup succeeds, then
419 is expanded and appended to the output;
422 is present, then it is expanded and appended to the output;
423 otherwise, nothing happens.
425 A dollar sign which doesn't introduce one of the forms above
426 is invalid, and a fatal error is reported.
428 Any other characters are simply appended to the output.
430 Word-splitting is similar but more complex.
431 The result is not a string, but a sequence of strings.
432 At any given point in this procedure,
433 there may be a partially constructed word,
436 Outside of quotes (see below),
437 whitespace serves to separate words.
438 When a whitespace character is encountered,
439 if there is a word under construction,
440 then it is finished and added to the output list;
441 otherwise it is simply ignored.
443 If a backslash is encountered,
444 then a word is started if there is none currently under construction,
445 and the character following the backslash is added to the current word.
447 If a single-quote character
450 then a word is started if there is none currently under construction,
453 characters up to the next single quote
454 are added to the current word.
455 This includes double quotes, dollar signs, and backslashes.
456 (Neither of the two single quotes is appended to the current word.)
458 If a double-quote character
461 then a word is started if there is none currently under construction.
462 Until the next double quote is encountered,
463 whitespace and single quotes are treated literally,
464 and simply added to the current word;
465 backslashes can be used to escape characters,
466 such as double quotes,
471 \(en a variable substitution or conditional (as described above) \(en
473 and there is a current word under construction,
474 then the result of the
476 is appended to the current word.
477 If there is no current word,
478 then the variable value, or consequent or alternative text,
479 is subjected to word splitting in addition to expansion,
480 and the resulting words appended to the output sequence.
482 If any other character is encountered,
483 then a word is started if there is none currently under construction,
484 and the character is appended to the current word.
486 One case which deserves attention:
489 is encountered outside of a word,
490 so that the result is subject to word splitting,
491 then an error is reported if a new word is started
492 without there being whitespace between the closing brace of the
494 and the character which started the new word.
497 .B "bad = one ${x}two"
499 would be invalid in a word-splitting context.
501 .SS "Other special variables"
502 In every section, the section's name
503 is automatically assigned to the variable
507 be overridden by an explicit assignment,
508 but this is not recommended.
510 .SS "Predefined variables in @BUILTIN"
513 section has no parents.
514 You should not override its settings in configuration files.
515 It holds a number of variables set by the
521 The directory in which
523 auxiliary data files and scripts are located.
524 This is determined by the
526 environment variable,
532 or a value determined at compile time.
536 The preferred option prefix for ECL, either
541 the ECL developers are changing
542 the way ECL recognizes command-line options,
543 because they think that the minor \(aesthetic improvement
544 is worth breaking everyone's scripts.)
545 This is determined by the
550 or a value determined at compile time.
555 .BR dump-runlisp-image (1)
557 (a string of hexadecimal digits)
558 identifying the versions of the Lisp code included
559 \(en or to be included \(en
561 This is constructed by hashing the result of evaluating the
563 expression in the system definition.
567 The directory in which
570 .B dump-runlisp-image
571 stores, custom Lisp images.
572 This is determined by the
574 environment variable,
580 or a value determined at compile time.
584 The well-known name of the image;
585 actually a symbolic link to the `real' image file,
586 whose name includes a hash
587 which identifies the versions of the Lisp code included in the image.
592 .BR dump-runlisp-image (1)
593 to the filename that a
595 command should create.
596 .RB ( dump-runlisp-image
597 will rename the image into place itself,
598 if the command completes successfully.)
603 .BR dump-runlisp-image (1)
604 to the name to use for the updated symbolic link to the image file.
605 This is used internally,
606 and is not expected to be useful in Lisp system definitions.
611 .BR dump-runlisp-image (1)
612 to the filename of the intended output image.
623 to the name of the script being invoked.
628 .BR dump-runlisp-image (1)
629 to be the name of a directory in which a
631 command can put temporary files.
633 .SS "Environment variables in @ENV"
637 and is used to hold a copy of the system environment.
639 it contains an assignment for every environment variable.
642 section has no parents.
643 The values are not expandable.
644 It is possible to override
646 settings in configuration files
647 or on the command line,
648 but this is not recommended.
650 .SS "The @COMMON section"
653 is the default parent for nearly all other configuration sections
654 (the exceptions being
658 which have no parents, and
660 itself, whose parent is
662 It is used in the provided configuration
663 to hold various common snippets of Lisp code and other settings,
666 programs themselves make no direct use of it.
668 .SS "Overall configuration in @CONFIG"
671 are consulted for various administrative reasons.
673 Because of the open-ended nature of this configuration mechanism,
674 users can easily invent new configuration variables
675 for any purpose they can imagine.
676 The following variables are used by the
678 programs directly, or its default configuration.
679 All values are expanded before use;
688 The directory in which
690 auxiliary data files and scripts are located.
691 There is a hardcoded default
692 determined at compile-time,
693 which is probably correct.
696 environment variable.
697 Don't refer to this setting directly:
706 A comma-separated list of Lisp implementation names
707 which should have custom images dumped by
708 .BR "dump-runlisp-image \-a" .
709 The order is not especially significant.
710 The default is all of the configured implementations
714 and whose command can be found.
718 The preferred option prefix for ECL, either
722 There is a hardcoded default
723 determined at compile-time,
724 which was correct for the system on which
727 Don't refer to this setting directly:
736 The directory in which
739 .B dump-runlisp-image
740 stores, custom Lisp images.
743 environment variable.
744 Don't refer to this setting directly:
753 A comma-separated list of names of
755 Lisp implementations.
758 environment variable.
760 .SS "Lisp implementation definitions"
761 A Lisp implementation is described to
763 by a configuration section.
764 The section's name is used to refer to the implementation,
773 lists described above.
775 The following variable settings are used directly;
776 of course, a Lisp implementation definition may contain other settings
777 for internal purposes.
781 The name of the program used to invoke the Lisp implementation.
782 .BR dump-runlisp-image
783 looks to see whether this program is installed when invoked with the
786 it will fail if there is no
790 (but not universally)
796 It's conventional to set this to
798 so that the command name can be overridden from the environment.
802 The complete command to use to dump a custom image
803 for this Lisp implementation.
804 The value is subjected to expansion and word-splitting before use.
805 It should write the newly created image to the file named by the
813 The basename of the custom image file
814 (i.e., not containing any
817 to use when invoking this Lisp implementation.
820 .BR dump-runlisp-image (1)
821 use the presence of this setting to decide
822 whether the implementation supports custom images.
826 The complete (but not necessarily absolute) pathname
827 of the custom image file for this Lisp implementation.
828 It is the (expanded) value of this variable
831 when it checks whether a custom image exists.
833 .B ${@image-dir}/${image-file}
834 in the standard configuration file's
837 and there is probably no need to override it;
841 section \(en see above \(en and
843 must be set in this section
844 (or one of its ancestors)
847 would not attempt to check for an image file.
851 The complete command to use
852 to get this Lisp implementation to execute a script.
853 The value is subjected to expansion and word-splitting before use.
854 The script name is available as
858 section \(en see above.
859 If a custom image is available, then
867 the full path to the image file to use is given by
871 .\"--------------------------------------------------------------------------
874 .BR dump-runlisp-image (1),
875 .BR query-runlisp-config (1),
879 Mark Wooding, <mdw@distorted.org.uk>
881 .\"----- That's all, folks --------------------------------------------------