[erlang-patches] Shell History to Erlang

Henrik Nord <>
Mon Feb 13 10:28:33 CET 2012


This will have to wait for a technical board meeting. I will let you 
know as soon as the meeting has been held.

Thank you for the contribution!

On 02/09/2012 04:24 AM, Fred Hebert wrote:
> Hi there,
> I have made a hack named erlang-history available a few months ago and 
> since then I've kept maintaining it in a public repo on github 
> (https://github.com/ferd/erlang-history).
> It's basically just a small modification to kernel/group.erl and a new 
> module called group_history.erl. I've used DETS tables at this point 
> in time, as it was (at first) easy to store stuff that way. The old 
> requests are injected into the shell when it first starts up (and it 
> does so for all instances of the shell on a given node). They're saved 
> to disk when the command stack/zipper gets saved after a new line.
> The other reason for using DETS, aside for not reinventing stuff, is 
> that it's part of stdlib, which is always there anyway. The only 
> downside is that repairing DETS tables uses the group leader and when 
> the group.erl group leader calls it, it can get stuck in a loop -- 
> that's accounted for in the code.
> Anyway, it also supports a full set of options, added to 'kernel': 
> number of lines saved, where to save them, terms to drop from history, 
> etc. They're described in the README of the repository.
> To make a long story short, I'm wondering if this kind of material has 
> any chance of making it into OTP proper, rather than just being a 
> hack/patch to apply after installing Erlang.
> I know there are no tests, but then, group.erl also has no tests and 
> it's difficult to test it all (which I figure could make the OTP team 
> reluctant to including it). I could add tests for the 
> group_history.erl module itself if required though, but some features 
> would definitely be hard to properly test (such as the group leader 
> stuff above).
> Regards,
> Fred Hebert.
> _______________________________________________
> erlang-patches mailing list
> http://erlang.org/mailman/listinfo/erlang-patches

/Henrik Nord Erlang/OTP

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-patches/attachments/20120213/6214cf52/attachment.html>

More information about the erlang-patches mailing list