Roberto Rosetti <rob.rose...@gmail.com> writes: > 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.
Well I wasn't aware of it before, but I just looked at guile-readline/readline.c and noticed that there is a write-history primitive: SCM_DEFINE (scm_write_history, "write-history", 1, 0, 0, (SCM file), "") #define FUNC_NAME s_scm_write_history { char *filename; SCM ret; filename = scm_to_locale_string (file); ret = scm_from_bool (!write_history (filename)); free (filename); return ret; } #undef FUNC_NAME Is that a solution for you? Regards, Neil