From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from faui45.informatik.uni-erlangen.de ([131.188.2.45]) by hawkwind.utcs.utoronto.ca with SMTP id <24081>; Mon, 8 Aug 1994 05:27:50 -0400 Received: from faui01.informatik.uni-erlangen.de by uni-erlangen.de with SMTP; id AA09473 (5.65c-6/7.3w-FAU); Mon, 8 Aug 1994 11:27:23 +0200 Received: from faui06d.informatik.uni-erlangen.de by cip.informatik.uni-erlangen.de with SMTP; id AA00512 (5.65c-6/7.3m-FAU); Mon, 8 Aug 1994 11:27:20 +0200 From: "Markus Friedl (CIP 92)" Message-Id: <199408080927.AA00512@faui01.informatik.uni-erlangen.de> Subject: readline & history To: rc@hawkwind.utcs.toronto.edu (rc-mailing-list) Date: Mon, 8 Aug 1994 05:27:18 -0400 X-Mailer: ELM [version 2.4 PL23] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi! With the current version of rc I am not able to use the $history- file with the readline-interface (i.e. CTRL-p, CTRL-r, ...). The following patch forces rc to add the contents of the file to the history list. any comments? cu --markus =================================================================== RCS file: RCS/input.c,v retrieving revision 1.3 diff -u -r1.3 input.c --- 1.3 1994/06/22 08:31:07 +++ input.c 1994/08/07 21:39:33 @@ -23,6 +23,8 @@ #ifdef READLINE extern char *readline(char *); extern void add_history(char *); +extern int read_history(char *); +extern void using_history(void); static char *rlinebuf; #endif @@ -256,6 +258,9 @@ extern Node *doit(bool execit) { bool eof; +#ifdef READLINE + bool doinithist = TRUE; +#endif Jbwrap j; Estack e1, e2; Edata jerror; @@ -277,6 +282,18 @@ dashell = FALSE; b_dot(fname); } +#ifdef READLINE + if (doinithist && interactive) { + List *hist; + if (hist = varlookup("history")){ + using_history(); + read_history(hist->w); + } else { + fprint(2, "history not defined\n"); + } + doinithist = FALSE; + } +#endif if (interactive) { List *s; if (!dashen && fnlookup("prompt") != NULL) { -- Markus Friedl msfriedl@cip.informatik.uni-erlangen.de