summaryrefslogtreecommitdiff
path: root/elisp
diff options
context:
space:
mode:
authorAaron Marks <nymacro@gmail.com>2019-06-12 22:15:28 +1000
committerAaron Marks <nymacro@gmail.com>2019-06-13 18:20:51 +1000
commit25b4eafe82be36905aa43dc32a38ba65a43e5200 (patch)
tree6b04dbdb56334db21c85c61265b19ccf18bcc15f /elisp
parente60e1c2b1baf8891e1af010af491faf422eacd43 (diff)
downloadgeiser-guile-25b4eafe82be36905aa43dc32a38ba65a43e5200.tar.gz
geiser-guile-25b4eafe82be36905aa43dc32a38ba65a43e5200.tar.bz2
Introduce context-aware REPL send option
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.
Diffstat (limited to 'elisp')
-rw-r--r--elisp/geiser-repl.el19
1 files changed, 17 insertions, 2 deletions
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index abba2ea..014fb74 100644
--- a/elisp/geiser-repl.el
+++ b/elisp/geiser-repl.el
@@ -114,6 +114,20 @@ change that."
:type 'boolean
:group 'geiser-repl)
+(geiser-custom--defcustom geiser-repl-context-sensitive-send nil
+ "Don't send input to REPL without the cursor being placed at the
+end of prompt.
+
+When on, pressing \\[enter] when the cursor is placed inside a
+balanced S-expression will introduce a new line without sending
+input to the inferior Scheme process.
+
+When off (the default), pressing \\[enter] when the cursor is
+placed inside a balanced S-expression will send the input to
+the inferior Scheme process."
+ :type 'boolean
+ :group 'geiser-repl)
+
(geiser-custom--defcustom geiser-repl-forget-old-errors-p t
"Whether to forget old errors upon entering a new expression.
@@ -735,7 +749,8 @@ If SAVE-HISTORY is non-nil, save CMD in the REPL history."
(geiser-repl--grab-input)
(ignore-errors (compile-goto-error))))
((let ((inhibit-field-text-motion t))
- (end-of-line)
+ (unless geiser-repl-context-sensitive-send
+ (end-of-line))
(<= (geiser-repl--nesting-level) 0))
(geiser-repl--send-input))
(t (goto-char p)
@@ -837,7 +852,7 @@ buffer."
("Symbol documentation" ("\C-c\C-dd" "\C-c\C-d\C-d")
geiser-doc-symbol-at-point
"Documentation for symbol at point" :enable (geiser--symbol-at-point))
- ("Lookup symbol in manul" ("\C-c\C-di" "\C-c\C-d\C-i")
+ ("Lookup symbol in manual" ("\C-c\C-di" "\C-c\C-d\C-i")
geiser-doc-look-up-manual
"Documentation for symbol at point" :enable (geiser--symbol-at-point))
("Module documentation" ("\C-c\C-dm" "\C-c\C-d\C-m") geiser-repl--doc-module