From: Nikodemus Siivola Date: Fri, 10 Jun 2011 17:19:37 +0000 (+0300) Subject: export *USERINIT-PATHNAME-FUNCTION* and *SYSINIT-PATHNAME-FUNCTION* X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=92e62aeb1e845740b3ecb60ffcb825dbf1994ccc;p=sbcl.git export *USERINIT-PATHNAME-FUNCTION* and *SYSINIT-PATHNAME-FUNCTION* I have no idea why I didn't do that in the first place. --- diff --git a/NEWS b/NEWS index 9221aa1..5e912b3 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,9 @@ changes relative to sbcl-1.0.49: * enhancement: errors from FD handlers now provide a restart to remove the offending handler. + * enhancement: location of user or system initialization file can now easily + be customized for saved cores. See: SB-EXT:*USERINIT-PATHNAME-FUNCTION* + and SB-EXT:*SYSINIT-PATHNAME-FUNCTION*. * bug fix: bound derivation for floating point operations is now more careful about rounding possibly closing open bounds. (lp#793771) * bug fix: SB-POSIX:SYSCALL-ERROR's argument is now optional. (accidental diff --git a/doc/manual/start-stop.texinfo b/doc/manual/start-stop.texinfo index 362ad40..f97aef4 100644 --- a/doc/manual/start-stop.texinfo +++ b/doc/manual/start-stop.texinfo @@ -132,6 +132,13 @@ process, and is also provided as an extension to the user. @include fun-sb-ext-save-lisp-and-die.texinfo @include var-sb-ext-star-save-hooks-star.texinfo +In cases where the standard initialization files have already been loaded +into the saved core, and alternative ones should be used (or none at all), +SBCL allows customizing the initfile pathname computation. + +@include var-sb-ext-star-sysinit-pathname-function-star.texinfo +@include var-sb-ext-star-userinit-pathname-function-star.texinfo + To facilitate distribution of SBCL applications using external resources, the filesystem location of the SBCL core file being used is available from Lisp. diff --git a/package-data-list.lisp-expr b/package-data-list.lisp-expr index 80a6f61..92395f4 100644 --- a/package-data-list.lisp-expr +++ b/package-data-list.lisp-expr @@ -580,11 +580,15 @@ like *STACK-TOP-HINT* and unsupported stuff like *TRACED-FUN-LIST*." :name "SB!EXT" :doc "public: miscellaneous supported extensions to the ANSI Lisp spec" :use ("CL" "SB!ALIEN" "SB!INT" "SB!SYS" "SB!GRAY") - :export ( ;; Information about how the program was invoked is + :export (;; Information about how the program was invoked is ;; nonstandard but very useful. "*POSIX-ARGV*" "*CORE-PATHNAME*" "*RUNTIME-PATHNAME*" "POSIX-GETENV" "POSIX-ENVIRON" + ;; Customizing initfile locations + "*USERINIT-PATHNAME-FUNCTION*" + "*SYSINIT-PATHNAME-FUNCTION*" + ;; Atomic operations and types related to them "COMPARE-AND-SWAP" "ATOMIC-INCF" diff --git a/src/code/toplevel.lisp b/src/code/toplevel.lisp index c9986bf..05445b9 100644 --- a/src/code/toplevel.lisp +++ b/src/code/toplevel.lisp @@ -56,16 +56,17 @@ (defvar *sysinit-pathname-function* #'sysinit-pathname #!+sb-doc - "Designator for a function of zero arguments called to obtain a pathname -designator for the default sysinit file, or NIL. If the function returns NIL, -no sysinit file is used unless one has been specified on the command-line.") + "Designator for a function of zero arguments called to obtain a +pathname designator for the default sysinit file, or NIL. If the +function returns NIL, no sysinit file is used unless one has been +specified on the command-line.") (defvar *userinit-pathname-function* #'userinit-pathname #!+sb-doc - "Designator for a function of zero arguments called to obtain a pathname -designator or a stream for the default userinit file, or NIL. If the function -returns NIL, no userinit file is used unless one has been specified on the -command-line.") + "Designator for a function of zero arguments called to obtain a +pathname designator or a stream for the default userinit file, or NIL. +If the function returns NIL, no userinit file is used unless one has +been specified on the command-line.") ;;;; miscellaneous utilities for working with with TOPLEVEL