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

Featuring the Dragonfly web framework
Locked
newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

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

Post 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..
-- (define? (Cornflakes))

Locked