Page 1 of 1

[5 cents for today] auto source with exit 1-liner

Posted: Tue Apr 22, 2008 8:07 pm
by newdep
Sometimes you want to save all your functions/defines./contexts from
the newlisp console or just log your activity. Well that can be done
with -L or -l but for the linux/unix users there is another option.

You can bind the console exit to a signal, because i work with xterm
it handles ctrl-4 as (quit). When I press it the function saves and exits.
(put it in your init.lsp, pressing ctrl-4 sources to newlisp.log and exits)

cltr-4 sources and exits, a normal ctrl-d / (exit) , cltr-c does nothing..
(define (ctrl-4 sig) (append-file "newlisp.log" (string "\n==" (date) "==\n" (source) "\n")) (exit)) (signal 3 'ctrl-4)
Enjoy..