On friday, 14/08/2009 alle 22.39 +0100, Neil Jerram writes: > > > Hi all, > > > > I'm wondering how to flush the recent readline history to a file. I need > > this > > feature for an educational project. > > The purpose is to permit the REPL user to save his entire history with a > > simple ..... > Hi Roberto, > > The readline history is already saved to a file, ~/.guile_history. > Does that provide what you need? > > (I'm not sure offhand if it is saved after every line is entered, or > when you quit Guile; but maybe that difference is not important for > you anyway.)
> Neil Well, thanks for the answer Neil. I know about the existence of ~/.guile_history, but my problem is more complex: I need a hook to the history buffer, like a port or something. A way to flush the history to its file at a given command. Just to grab everything written before and then manipulate (a copy of) the history file. For the moment, I've written a simple wrapper for readline, that process the input and save every command to a specific text file, after checking it for correctness. An alternate solution may be to change the GUILE_HISTORY envrironment variable at run-time, but I thing it's not an elegant solution at all. Rob -- Roberto Rosetti OpenPGP Public key: 30575161
