I'm working on my Lisp in a Box distro and I want to make SLIME load .swank.lisp from somewhere other than USER-HOMEDIR-PATHNAME. I'm not sure what the best way to do that is. Looks like the simplest least intrusive way would be to change swank-loader's USER-INIT-FILE to something like:
(defun user-init-file () "Return the name of the user init file or nil." (probe-file (merge-pathnames (or (SOME-MAGIC-HERE) (user-homedir-pathname)) (make-pathname :name ".swank" :type "lisp"))))
Do folks have any objection to this? And if not, does anyone have any ideas about what SOME-MAGIC-HERE should do? Ideally I'd like something that will work on OS X, GNU/Linux, and Windows.
Or another way to achieve my goal, is to have swank-loader load a file, site-swank.lisp if it exists and to define a variable which will turn off loading of the user-init-file. Then I can build a site-swank.lisp that does the initialization I need for Lispbox and then disable loading of the users .swank.lisp. (I want to do this because the whole point of my Lispbox distro is to provide a stable a predictable environment.
-Peter
Peter Seibel peter@gigamonkeys.com writes:
Or another way to achieve my goal, is to have swank-loader load a file, site-swank.lisp if it exists and to define a variable which will turn off loading of the user-init-file. Then I can build a site-swank.lisp that does the initialization I need for Lispbox and then disable loading of the users .swank.lisp. (I want to do this because the whole point of my Lispbox distro is to provide a stable a predictable environment.
i'm confused, why don't you just edit the swank-loader.lisp you distribute with lisp in a box? would this change provide some benefit other than making lisp in a box easier to build?
"Marco Baringer" mb@bese.it writes:
Peter Seibel peter@gigamonkeys.com writes:
Or another way to achieve my goal, is to have swank-loader load a file, site-swank.lisp if it exists and to define a variable which will turn off loading of the user-init-file. Then I can build a site-swank.lisp that does the initialization I need for Lispbox and then disable loading of the users .swank.lisp. (I want to do this because the whole point of my Lispbox distro is to provide a stable a predictable environment.
i'm confused, why don't you just edit the swank-loader.lisp you distribute with lisp in a box? would this change provide some benefit other than making lisp in a box easier to build?
Assuming the idea is to avoid forking (however slightly) then the second option (first load site-swank.lisp in same dir as swank-loader) sounds fine to me.
"Marco Baringer" mb@bese.it writes:
Peter Seibel peter@gigamonkeys.com writes:
Or another way to achieve my goal, is to have swank-loader load a file, site-swank.lisp if it exists and to define a variable which will turn off loading of the user-init-file. Then I can build a site-swank.lisp that does the initialization I need for Lispbox and then disable loading of the users .swank.lisp. (I want to do this because the whole point of my Lispbox distro is to provide a stable a predictable environment.
i'm confused, why don't you just edit the swank-loader.lisp you distribute with lisp in a box? would this change provide some benefit other than making lisp in a box easier to build?
Well, if I can make one small change to swank-loader.lisp that can accomodate this kind of customization and it gets folded into the mainline then I don't have to track further changes to swank-loader.lisp. While I may be the only one who needs to customize SLIME in this way at the moment it's not a particularly Lispbox specific change--I'm just making it possible for anyone installing SLIME to customize where it looks for .swank.lisp while leaving the default behavior to look in the user's home dir.
-Peter
Peter Seibel peter@gigamonkeys.com writes:
"Marco Baringer" mb@bese.it writes:
Peter Seibel peter@gigamonkeys.com writes:
Or another way to achieve my goal, is to have swank-loader load a file, site-swank.lisp if it exists and to define a variable which will turn off loading of the user-init-file. Then I can build a site-swank.lisp that does the initialization I need for Lispbox and then disable loading of the users .swank.lisp. (I want to do this because the whole point of my Lispbox distro is to provide a stable a predictable environment.
i'm confused, why don't you just edit the swank-loader.lisp you distribute with lisp in a box? would this change provide some benefit other than making lisp in a box easier to build?
Well, if I can make one small change to swank-loader.lisp that can accomodate this kind of customization and it gets folded into the mainline then I don't have to track further changes to swank-loader.lisp. While I may be the only one who needs to customize SLIME in this way at the moment it's not a particularly Lispbox specific change--I'm just making it possible for anyone installing SLIME to customize where it looks for .swank.lisp while leaving the default behavior to look in the user's home dir.
ok, that makes sense, would this work? it loads the file site-init.lisp if it exists, otherwise it loads .swank.lisp. if you provide a site-init.lisp its up to you, as the all-knowing all-seeing sysop, to load the user's init-files by calling (swank-loader:load-user-init-file).
"Marco Baringer" mb@bese.it writes:
Peter Seibel peter@gigamonkeys.com writes:
"Marco Baringer" mb@bese.it writes:
Peter Seibel peter@gigamonkeys.com writes:
Or another way to achieve my goal, is to have swank-loader load a file, site-swank.lisp if it exists and to define a variable which will turn off loading of the user-init-file. Then I can build a site-swank.lisp that does the initialization I need for Lispbox and then disable loading of the users .swank.lisp. (I want to do this because the whole point of my Lispbox distro is to provide a stable a predictable environment.
i'm confused, why don't you just edit the swank-loader.lisp you distribute with lisp in a box? would this change provide some benefit other than making lisp in a box easier to build?
Well, if I can make one small change to swank-loader.lisp that can accomodate this kind of customization and it gets folded into the mainline then I don't have to track further changes to swank-loader.lisp. While I may be the only one who needs to customize SLIME in this way at the moment it's not a particularly Lispbox specific change--I'm just making it possible for anyone installing SLIME to customize where it looks for .swank.lisp while leaving the default behavior to look in the user's home dir.
ok, that makes sense, would this work? it loads the file site-init.lisp if it exists, otherwise it loads .swank.lisp. if you provide a site-init.lisp its up to you, as the all-knowing all-seeing sysop, to load the user's init-files by calling (swank-loader:load-user-init-file).
Yup. That'd do the trick.
-Peter