mickeyp · 2022-08-02 19:42
00-11 · 2022-08-02 20:41
+1.
Minor nit -
> An S-expression is, put simply, anything in brackets.
Simply, but not completely. Sexps include not only lists but also *atoms* (which includes symbols, strings, vectors, numbers, and characters).
Yes, the examples after that sentence, included mention of numbers and strings. But many people do think of sexps as being (only) lists.
----
You might want to bind `M-:` to `pp-eval-expression`, if reading the result is often important to you.
(I use the version of that command from [`pp+.el`](https://www.emacswiki.org/emacs/PpPlus) ([code](https://www.emacswiki.org/emacs/download/pp%2b.el)).)
----
See also Emacs Wiki page [Evaluating Expressions](https://www.emacswiki.org/emacs/EvaluatingExpressions).
_oats · 2022-08-03 02:41
Your writing is truly an asset to the emacs community, great stuff.
oantolin · 2022-08-03 04:30
> But the scratch buffer is a poor substitute for a proper REPL, but thankfully Emacs does come with one of those too.
I'd say its the other way around: a REPL is a poor substitute for a scratch buffer. I really like fixing an expression I got wrong and leaving a clean a history in the buffer.
mickeyp · 2022-08-03 05:00
Good catch, Drew. Thanks!
eshelyaron · 2022-08-03 05:33
Really enjoyed reading this, thank you Mickey.
Note that in Emacs 29, eval-buffer got a default keybinding of C-c C-e
_viz_ · 2022-08-03 10:16
You can have a clean history in the buffer if you edit the old input and send it to the process.
oantolin · 2022-08-03 12:50
Sure, but it seems less convenient than editing a scratch buffer. Sometimes REPL buffers rebind some motion keys (like `<up>` and `<down>` for history) or have some portions read only. You can of course edit them but it can be more cumbersome.
_viz_ · 2022-08-03 12:58
Indeed. If the point stayed in the same place without moving, maybe it wouldnt be too bad.
quote-only-eeee · 2022-08-27 08:11
Oh, that's a very useful extra piece of information!