summaryrefslogtreecommitdiff
path: root/elisp/geiser-repl.el
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-03-28 06:58:44 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-03-28 06:58:44 +0200
commit026d74f89ea69d94c10e4048cab3b58a2b20cc0a (patch)
treeb2769375e2e14b07e9c672433d25446ccbe4aacf /elisp/geiser-repl.el
parent8ce1dace8890759b14752613edb11a35399c33df (diff)
downloadgeiser-026d74f89ea69d94c10e4048cab3b58a2b20cc0a.tar.gz
geiser-026d74f89ea69d94c10e4048cab3b58a2b20cc0a.tar.bz2
More robust REPL input handling.
Diffstat (limited to 'elisp/geiser-repl.el')
-rw-r--r--elisp/geiser-repl.el10
1 files changed, 9 insertions, 1 deletions
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index 9e66901..b7401b9 100644
--- a/elisp/geiser-repl.el
+++ b/elisp/geiser-repl.el
@@ -336,11 +336,19 @@ module command as a string")
(insert "\n")
(lisp-indent-line)))
+(defun geiser-repl--nesting-level ()
+ (let ((begin (if comint-last-prompt-overlay
+ (overlay-end comint-last-prompt-overlay)
+ (save-excusion (geiser-repl--bol) (point)))))
+ (save-restriction
+ (narrow-to-region begin (point-max))
+ (geiser-syntax--nesting-level))))
+
(defun geiser-repl--send-input ()
(interactive)
(let ((p (point)))
(end-of-line)
- (if (zerop (geiser-syntax--nesting-level))
+ (if (<= (geiser-repl--nesting-level) 0)
(comint-send-input)
(goto-char p)
(if geiser-repl-auto-indent-p