Eval-result-overlays in Emacs-lisp29 Mar 2016, by Artur Malabarba.
One of the things I like most in CIDER is how evaluation results are displayed by inline overlays. And yet, for some reason, it’s taken me almost a year to transfer that to Elisp.
It’s the tiniest of changes — you’re just taking something that would be displayed in the minibuffer and moving it up a dozen or so lines — but the difference is palpable. By displaying the result inline, you display it where the user is looking, instead of forcing them to shift focus. The quick-feedback loop we all love in our lisps becomes even faster (something I would’ve thought impossible one year ago).
Assuming you already have CIDER installed, porting this feature to Elisp is almost trivial. We just define a small wrapper around the function that creates the overlay, and then advise the relevant elisp commands to call it.
If I like this enough, I might implement it more properly and propose its addition to Emacs core. For now the advices are more than enough.
If you don’t want to install CIDER, you can just copy that function to your
configs (you’ll also have to copy the functions above it in the same file, and
when-let definition from