summaryrefslogtreecommitdiff
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
commit59082944ab8561cafb0602f695669c4b47366fbd (patch)
treee07a29c0743e0a8bbf9719b9d50a7bd6d382fc89
parent18f9bcddb71d118aebaff6222a10c696085deaa1 (diff)
downloadgeiser-59082944ab8561cafb0602f695669c4b47366fbd.tar.gz
geiser-59082944ab8561cafb0602f695669c4b47366fbd.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.
-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