Newlisp init.lsp enhancement request

Q&A's, tips, howto's
Locked
newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Newlisp init.lsp enhancement request

Post by newdep »

Hello Lutz,

The global init.lsp is located for linux /usr/share/newlisp

is it possible to enhance the reading of the init.lsp with the following.
(or inside the .c code or inside the init.lsp itself)

If exists in $HOME/.init.lsp then load else load /usr/share/newlisp/init.lsp

So its a .init.lsp (mind the extra "." to make it a hidden init.lsp)

What do you think?

Personaly i think its usefull because every new install of newlisp overwrites
the /usr/share/newlisp/init file. The ~/.init.lsp is controlled by the user itself and the global init.lsp stays for the rest of the users..

Secondly makes it more practical if you want to run newlisp in -p or -d mode as a certain user with that .init.lsp file...

regards, Norman.
-- (define? (Cornflakes))

newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post by newdep »

Luts..

If something like this would be default i.e. in the init.lsp it will load
After the global init.lsp the users specified ~/.init.lsp ->

Just an example...

(if linux.......
(begin
(if (set 't (append (set 't (env "HOME")) "/.init.lsp" )) (load t))))


Norman.
-- (define? (Cornflakes))

newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post by newdep »

Mmm worked once got ->

call stack overflow in function set : env

:-)
-- (define? (Cornflakes))

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

That is a message from newLISP not from the OS, perhaps some recursion in your program? The culprit is most likely not 'env', this is just where the call stack overflows, you could check with 'sys-info' how deep nested you are before it breaks.

Lutz

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Apropos reading the init.lsp file from the $HOME dir, yes Norman, we can do that

Lutz

ps: try the latest in http://newlisp.org/downloads/development/Norman/
trying to fix the -d problem on slackware

newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post by newdep »

Thanx Lutz would be a nice enhancement...

Speaking of "we" are there more people involved in the code development
of the current newlisp releases then? Or are you with the two of you :-)
-- (define? (Cornflakes))

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

just me

Lutz

Locked