shithub: femtolisp

Download patch

ref: 47b897444394f1cc9e7c130fc97fb2ddfd4817e5
parent: a69ab620c009be7b32f8c881d0068ce0c52c52fb
author: mag <[email protected]>
date: Tue Apr 4 15:56:33 EDT 2023

startup script in interactive sessions

--- a/system.lsp
+++ b/system.lsp
@@ -1045,6 +1045,13 @@
 	    (lambda (e) (begin (top-level-exception-handler e)
 			       (exit 1)))))
 
+(define (__rcscript)
+  (let ((fname (case *os-name*
+               ((unknown) "")
+               ((plan9) (string (os.getenv "home") "/lib/flisprc"))
+               (else (string (os.getenv "HOME") "/.flisprc")))))
+    (if (path.exists? fname) (load fname))))
+
 (define (__start argv)
   (__init_globals)
   (if (pair? (cdr argv))
@@ -1054,5 +1061,6 @@
       (begin (set! *argv* argv)
 	     (set! *interactive* #t)
 	     (princ *banner*)
+             (__rcscript)
 	     (repl)))
   (exit 0))