Mercurial > hg > dtl-dml-home
changeset 40:d75099ce5f13
Save prolog history intermittently
author | samer |
---|---|
date | Thu, 12 Mar 2015 13:12:54 +0000 |
parents | 11abda02707a |
children | d9a205bd28fa |
files | .plrc |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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),