On Fri, 2012-11-30 at 11:49 +0100, Ludovic Courtès wrote: > Hello! > > nalaginrut <nalagin...@gmail.com> skribis: > > > I want to do some magic to let REPL display in color. > > But I found there's no content about REPL hook in Guile manual. > > And how can I get the result-string which the REPL is going to output? > > Looking at ‘run-repl’ (system repl repl), there’s ‘before-eval-hook’. > Then, in ‘repl-print’, there’s ‘before-print-hook’. There are no > ‘after’ hooks, though. > > Does that answer your question? >
Thanks ludo! With your helo, I can easily hack the colorized REPL now! But I realized that the hook maybe an improper way to go, it'll print twice: -----------------example--------------- 123 (colorized output) $1 = 123 (normal output) -------------------end----------------- And I checked the code, it'll call 'pp' after 'before-print-hook', so the add the colorized code into 'pp' will be more pretty. I think a colorized REPL is useful for our users. Will you accept a patch to 'pp' for colorized REPL? Or an easy way, a module with hook to do the same job, but output twice? > Thanks, > Ludo’.