Skip to content

Introduce context-aware REPL send option

nymacro requested to merge nymacro/geiser:context-aware-send into master

This option allows for easier editing of expressions on the REPL without accidentally sending the input to the inferior Scheme.

When turned on, the REPL behaves similarly to the Chez REPL. When the cursor is inside an S-expression, pressing [enter] will add a newline rather than sending the input. Moving the cursor beyond the closing parentheses and pressing [enter] will send the input.

TECHNICAL NOTE: while this works, I'm not sure how inhibit-text-field-motion and end-of-line are interacting with geiser-repl--nesting-level (and it doing (narrow-to-region (geiser-repl--last-prompt-end) (point-max))). I was thinking of introducing additional arguments to gerbil-repl--nesting-level to allow for more control over syntax parsing via syntax-ppss, but it worked without this change.

PERSONAL NOTE: I haven't been using Geiser too much lately, but accidentally sending input to Scheme was something I constantly found myself doing! Hopefully this isn't a controversial change. 😃

Merge request reports