chiark / gitweb /
runlisp.c, README.org: Ignore unknown permitted Lisp systems.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 17 Jun 2024 11:51:15 +0000 (12:51 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 17 Jun 2024 11:56:26 +0000 (12:56 +0100)
This is essential for script portability, and I should have thought
about it much earlier.

README.org
doc/README.pdf
runlisp.1.in
runlisp.c

index 821b4c90deedf6a20449bc40f6f1226cd9ed9e5f..fd8c9e4083c2b126ea2982cac9680f95ca981751 100644 (file)
@@ -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
index 7b0791221fccf93908d253cb96672302dcbe70d3..cb0e1b3cd57a36cde1265d507b60c2e8e62c3bdd 100644 (file)
Binary files a/doc/README.pdf and b/doc/README.pdf differ
index 67baa5ad826d9029fb61421e0f4d3b17261a4dbe..c015ea05b901112fbbac2dc7f13f0732a631887c 100644 (file)
@@ -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
index 87c478f91c408e783f170006b6c55b19d57a51e7..379259c5735326134449917e81c6dc3953749d9a 100644 (file)
--- 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. */