# HG changeset patch # User samer # Date 1426165974 0 # Node ID d75099ce5f13a65fe5cc19d6ceceb500013d505a # Parent 11abda02707a32e8e7ef59db469e43744cc5dbc1 Save prolog history intermittently diff -r 11abda02707a -r d75099ce5f13 .plrc --- a/.plrc Tue Feb 24 21:27:44 2015 +0000 +++ b/.plrc Thu Mar 12 13:12:54 2015 +0000 @@ -8,8 +8,13 @@ format_time(string(Time),'%+',Now), format(atom(Header),'% Start: ~w - argv=~w.\n',[Time,ARGV]), rl_add_history(Header), + alarm(60,periodic_save_history(H),_,[remove(true)]), at_halt(rl_write_history(H)). +periodic_save_history(H) :- + rl_write_history(H), + alarm(60,periodic_save_history(H),_,[remove(true)]). + colour_terminal :- stream_property(user_output, tty(true)), getenv('TERM',Term),