On Thu, Jul 22, 2021 at 10:53:53PM +0800, Hongyi Zhao wrote: > On Thu, Jul 22, 2021 at 10:38 PM wrote: > > > > On Thu, Jul 22, 2021 at 09:56:09PM +0800, Hongyi Zhao wrote: > > > > [...] > > > > > Suppose I've the following content in scratch buffer: > > > > > > (re-search-forward "\f") > > > ^L > > > > > > I put the point at the end of sexp line, and hit `C-j' to evaluate it. > > > I find that each time after the sexp has been evaluated successfully, > > > the `^L' line will be moved to the next line. See the screenshot in > > > the attachment, where I've evaluated the sexp 4 times. > > > > > > Any hints for this behavior? > > > > That depends on what C-j is bound to. What does say "describe-key", > > aka C-h C-k? > > `C-h k C-j RET': > ;;; > C-j runs the command eval-print-last-sexp (found in > lisp-interaction-mode-map), which is an interactive compiled Lisp > function in ‘elisp-mode.el’. Ah. You seem to be in a "lisp interaction" buffer. Then it's clear: it's the `print' part of `eval-print-last-sexp' what is inserting stuff in your buffer: the value of (re-search-forward "\f"). Before it does a newline (that is what moves the ^L forward), then the searching and moving of point happens, then (you should see that, too, the expression's value (point's position, an integer) is inserted: you should get a number after the ^L, too. Cheers - t