summaryrefslogtreecommitdiff
path: root/elisp/geiser-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'elisp/geiser-mode.el')
-rw-r--r--elisp/geiser-mode.el10
1 files changed, 9 insertions, 1 deletions
diff --git a/elisp/geiser-mode.el b/elisp/geiser-mode.el
index b1df1b6..9ea4d60 100644
--- a/elisp/geiser-mode.el
+++ b/elisp/geiser-mode.el
@@ -110,7 +110,9 @@ individual sexps."
With prefix, goes to the REPL buffer afterwards (as
`geiser-eval-region-and-go'). The evaluation is performed
asynchronously: this function's return value can be used to wait
-for its completion using `geiser-eval-wait'."
+for its completion using `geiser-eval-wait'. See also
+`geiser-eval-region/wait' if you just need to eval a region
+programmatically in a synchronous way."
(interactive "rP")
(save-restriction
(narrow-to-region start end)
@@ -122,6 +124,12 @@ for its completion using `geiser-eval-wait'."
(not raw)
nomsg))
+(defun geiser-eval-region/wait (start end &optional timeout)
+ "Like `geiser-eval-region', but waiting for the evaluation to finish.
+Returns its raw result, rather than displaying it. TIMEOUT is the
+number of seconds to wait for the evaluation to finish."
+ (geiser-debug--send-region/wait nil start end (* 1000 (or timeout 10))))
+
(defun geiser-eval-region-and-go (start end)
"Eval the current region in the Geiser REPL and visit it afterwads."
(interactive "r")