From: Mark Wooding Date: Mon, 17 Jun 2024 11:51:15 +0000 (+0100) Subject: runlisp.c, README.org: Ignore unknown permitted Lisp systems. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/runlisp/commitdiff_plain/7e3a86038e2a2cbb48b356cb029f9de99c14ec79?hp=6df280cddef4ab6cf14d7ec135c719e6c7d27040 runlisp.c, README.org: Ignore unknown permitted Lisp systems. This is essential for script portability, and I should have thought about it much earlier. --- diff --git a/README.org b/README.org index 821b4c9..fd8c9e4 100644 --- a/README.org +++ b/README.org @@ -69,6 +69,13 @@ in the ~-L~ option, separated by commas: : #-(or sbcl ccl) "an unexpected" : " Common Lisp!~%")) +It is not an error to include the name of an unrecognized Lisp system in +the ~-L~ option: such names are simply ignored. This allows a script to +declare support for unusual or locally installed Lisp systems without +compromising its portability to sites where such systems are unknown, or +which are still running older versions of ~runlisp~ which haven't been +updated with the necessary configuration for those systems. + ** Embedded options If your script requires features of particular Lisp implementations diff --git a/doc/README.pdf b/doc/README.pdf index 7b07912..cb0e1b3 100644 Binary files a/doc/README.pdf and b/doc/README.pdf differ diff --git a/runlisp.1.in b/runlisp.1.in index 67baa5a..c015ea0 100644 --- a/runlisp.1.in +++ b/runlisp.1.in @@ -174,10 +174,9 @@ This has no effect in eval mode. .TP .BI "\-L" "\fR, " "\-\-accept-lisp=" sys , sys ,\fR\*(.. Use one of the named Lisp systems. -Each +The .I sys -must name a supported Lisp system; -the names are separated by a comma +names are separated by a comma .RB ` , ' and/or one or more whitespace characters. This option may be given more than once: @@ -186,6 +185,13 @@ listing all of the systems named, in the same order. If a system is named more than once, a warning is issued (at verbosity level 1 or higher), and all but the first occurrence is ignored. +System names which do not refer to known Lisp systems +are silently ignored: +otherwise, a script which supports an unusual Lisp system +could never run at a site which doesn't have +configuration runes for that Lisp system, +even though they're useless +if the system isn't actually installed. . .TP .BI "\-c" "\fR, " "\-\-config-file=" conf diff --git a/runlisp.c b/runlisp.c index 87c478f..379259c 100644 --- a/runlisp.c +++ b/runlisp.c @@ -543,8 +543,7 @@ int main(int argc, char *argv[]) } *tail = 0; lisps.tail = tail; - /* Make sure that the acceptable and preferred Lisps actually exist. */ - check_lisps("acceptable", &accept, offsetof(struct lispsys, next_accept)); + /* Make sure that the preferred Lisps actually exist. */ check_lisps("preferred", &prefer, offsetof(struct lispsys, next_prefer)); /* If there are no acceptable Lisps, then we'll take all of them. */ @@ -559,13 +558,14 @@ int main(int argc, char *argv[]) /* Build the final list of Lisp systems in the order in which we'll try * them: first, preferred Lisps which are acceptable, and then acceptable - * Lisps which aren't preferred. + * Lisps which are known but not preferred. */ tail = &order.head; for (lisp = prefer.head; lisp; lisp = lisp->next_prefer) if (lisp->f&LF_ACCEPT) { *tail = lisp; tail = &lisp->next_order; } for (lisp = accept.head; lisp; lisp = lisp->next_accept) - if (!(lisp->f&LF_PREFER)) { *tail = lisp; tail = &lisp->next_order; } + if ((lisp->f&LF_KNOWN) && !(lisp->f&LF_PREFER)) + { *tail = lisp; tail = &lisp->next_order; } *tail = 0; /* Maybe dump out the various lists of Lisp systems we've collected. */