This would be very nice, with a couple of considerations:
zzamboni added a commit to zzamboni/dot-elvish that referenced this issue
Nov 14, 2017
With Elvish now supporting prompt caching (elves/elvish#482), I have removed the whole caching implementation from the prompt, which was messy and unreliable. I have also used the opportunity to write the code in literate programming style, using org-mode. See chain.org for the fully documented source code, from which chain.elv is generated. For an excellent introduction to literate programming using org-mode, see http://www.howardism.org/Technical/Emacs/literate-programming-tutorial.html.