From 9d02ab722536227d488a31f5d580bc41501a7f68 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 27 Oct 2015 06:27:11 -0700 Subject: Fix *listener-hist-len* in ~/.txr_profile not working. On startup, the history is trimmed to 100 lines regardless of the variable's value in the profile file. * parser.c (repl): Load the rc file first, then load the history file. Furthermore, call lino_hist_set_max_len between these operations with the latest value pulled from the *listener-hist-len* variable. --- parser.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/parser.c b/parser.c index 6caa3a41..5e607fd5 100644 --- a/parser.c +++ b/parser.c @@ -640,12 +640,14 @@ val repl(val bindings, val in_stream, val out_stream) lino_set_atom_cb(ls, provide_atom, 0); lino_set_tempfile_suffix(ls, ".tl"); - if (histfile) - lino_hist_load(ls, histfile_u8); - if (rcfile) load_rcfile(rcfile); + lino_hist_set_max_len(ls, c_num(cdr(hist_len_var))); + + if (histfile) + lino_hist_load(ls, histfile_u8); + while (!done) { val prompt = format(nil, lit("~a> "), counter, nao); val prev_counter = counter; -- cgit v1.2.3