Mercurial > hg > dml-home
changeset 59:8ff831293542
Removed persistent history stuff (now in rcutils); adjust proxy handling
author | samer |
---|---|
date | Wed, 20 May 2015 16:51:52 +0100 |
parents | 5038e67f3a6d |
children | 1a2e9d3adcb2 |
files | .swiplrc |
diffstat | 1 files changed, 2 insertions(+), 36 deletions(-) [+] |
line wrap: on
line diff
--- a/.swiplrc Tue May 19 11:09:47 2015 +0100 +++ b/.swiplrc Wed May 20 16:51:52 2015 +0100 @@ -1,38 +1,5 @@ :- op(200,fy,@). -:- dynamic persistent_history_file/1. -persistent_history(H) :- persistent_history(H,60). -persistent_history(H,Interval) :- - ( persistent_history_file(H) -> true - ; persistent_history_file(H1) -> throw(persistent_history_mismatch(H1,H)) - ; debug(history,'Will use persistent history in "~s", saving every ~d seconds.',[H,Interval]), - prolog_history(disable), - (exists_file(H) -> rl_read_history(H); true), - assert(persistent_history_file(H)), - current_prolog_flag(os_argv,ARGV), - atomics_to_string(ARGV," ",Command), - history_event('Start: ~s',[Command]), - periodic_save_history(Interval), - at_halt(history_event('Halt',[])) - ). - -history_event(Msg,Args) :- - persistent_history_file(H), - get_time(Now), - format_time(string(Time),'%+',Now), - format(string(Info),Msg,Args), - format(atom(Line),'% ~w | ~s',[Time,Info]), - debug(history,'History event: ~s',[Line]), - rl_add_history(Line), - rl_write_history(H). - - -periodic_save_history(Interval) :- - persistent_history_file(H), - debug(history,'Saving history to "~s"...',[H]), - rl_write_history(H), - alarm(Interval,periodic_save_history(Interval),_,[remove(true)]). - colour_terminal :- stream_property(user_output, tty(true)), getenv('TERM',Term), @@ -59,7 +26,7 @@ internal_host(Host) :- sub_atom(Host,_,_,0,'bl.uk'). :- multifile http:open_options/2. -http:open_options(Parts,[proxy(Host,Port),proxy_authorization(Auth)|Opts]) :- +http:open_options(Parts,[proxy(Host:Port),proxy_authorization(Auth)|Opts]) :- http_proxy(Host,Port,Auth), option(host(Target),Parts), \+internal_host(Target), @@ -73,8 +40,7 @@ verify_certificate(_,_,_,_,_) :- format(user_error,'Accepting certificate\n',[]). -:- %persistent_history('.swipl_history'), - (colour_terminal -> load_files(library(ansi_term), [silent(true)]); true), +:- (colour_terminal -> load_files(library(ansi_term), [silent(true)]); true), set_prolog_flag(prompt_alternatives_on, determinism), set_prolog_flag(editor, '$EDITOR'), load_files(library(url), [silent(true)]),