summaryrefslogtreecommitdiff
path: root/elisp/geiser-eval.el
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-12-29 00:32:08 +0000
committerjao <jao@gnu.org>2021-12-29 00:32:08 +0000
commite5357e6dcd221ba734423c68dc7a823c034d49d2 (patch)
tree4b7550aa13e039b9b7d3ea75239c9235862f77e6 /elisp/geiser-eval.el
parentf5e7004bf2f5af381dbf3387108cde210a190733 (diff)
downloadgeiser-e5357e6dcd221ba734423c68dc7a823c034d49d2.tar.gz
geiser-e5357e6dcd221ba734423c68dc7a823c034d49d2.tar.bz2
geiser-eval-wait -> geiser-wait-eval (and make it work)
Diffstat (limited to 'elisp/geiser-eval.el')
-rw-r--r--elisp/geiser-eval.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/elisp/geiser-eval.el b/elisp/geiser-eval.el
index 424d8e2..abf0b5c 100644
--- a/elisp/geiser-eval.el
+++ b/elisp/geiser-eval.el
@@ -1,4 +1,4 @@
-;;; geiser-eval.el -- sending scheme code for evaluation
+;;; geiser-eval.el -- sending scheme code for evaluation -*- lexical-binding: t; -*-
;; Copyright (C) 2009, 2010, 2011, 2012, 2013, 2015, 2021 Jose Antonio Ortega Ruiz
@@ -137,12 +137,19 @@ module-exports, autodoc, callers, callees and generic-methods.")
(defsubst geiser-eval--code-str (code)
(if (stringp code) code (geiser-eval--scheme-str code)))
+(defvar geiser-eval--async-retort nil)
(defsubst geiser-eval--send (code cont &optional buffer)
+ (setq geiser-eval--async-retort nil)
(geiser-con--send-string (geiser-eval--connection)
(geiser-eval--code-str code)
- cont
+ (lambda (s)
+ (setq geiser-eval--async-retort s)
+ (funcall cont s))
buffer))
+(defun geiser-eval--wait (req timeout)
+ (or (geiser-con--wait req timeout) geiser-eval--async-retort))
+
(defvar geiser-eval--sync-retort nil)
(defun geiser-eval--set-sync-retort (s)
(setq geiser-eval--sync-retort (geiser-eval--log s)))