From fc54b6c860dbbeb7ee48fad7cc6d49b17836d81b Mon Sep 17 00:00:00 2001 From: vindarel Date: Mon, 22 Apr 2024 14:21:26 +0200 Subject: [PATCH] scripting: run script in :ciel-user by default --- docs/scripting.md | 3 ++- scripting.lisp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/scripting.md b/docs/scripting.md index c292dfc..b17d7e0 100644 --- a/docs/scripting.md +++ b/docs/scripting.md @@ -33,7 +33,8 @@ $ ciel -s simpleHTTPserver 9000 #!/usr/bin/env ciel ;; optional shebang line, only for the short ./script call) -;; Start your script with this to access all CIEL goodies: +;; Start your script with this to access all CIEL goodies. +;; It is now also optional. (in-package :ciel-user) (defun hello (name) diff --git a/scripting.lisp b/scripting.lisp index 7b2d342..017dcdc 100644 --- a/scripting.lisp +++ b/scripting.lisp @@ -230,7 +230,8 @@ ;; The remaining free args are passed along to our script's arguments. ;; Here the file name is already a free arg, so args equals something like ;; '("simpleHTTPserver.lisp" "4242") aka it has the file name. - (let ((ciel-user:*script-args* args)) + (let ((ciel-user:*script-args* args) + (*package* (find-package :ciel-user))) (if (has-shebang (first args)) ;; I was a bit cautious about this function. ;; (mostly, small issues when testing at the REPL because of packages and local nicknames,