summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiogo F. S. Ramos <dfsr@riseup.net>2017-04-11 12:42:23 -0300
committerJose Antonio Ortega Ruiz <jao@gnu.org>2017-04-11 19:21:07 +0200
commit2834cd900779ad8966bc997f1a5c65122bbe3a63 (patch)
tree84b5226cd13c991c64734e411bdbe750f989f64d
parentfbd43f29691b3a3055413e69141061d7aaecca2a (diff)
downloadgeiser-2834cd900779ad8966bc997f1a5c65122bbe3a63.tar.gz
geiser-2834cd900779ad8966bc997f1a5c65122bbe3a63.tar.bz2
Eval last expression even after a comment char
Scan for beginning and end of a sexp, instead of using (point) as the end. Previously, if (point) was after a comment character, the REPL would freeze.
-rw-r--r--elisp/geiser-mode.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/elisp/geiser-mode.el b/elisp/geiser-mode.el
index aebdbce..b5c2029 100644
--- a/elisp/geiser-mode.el
+++ b/elisp/geiser-mode.el
@@ -144,8 +144,13 @@ With prefix, goes to the REPL buffer afterwards (as
With a prefix, revert the effect of `geiser-mode-eval-last-sexp-to-buffer' "
(interactive "P")
- (let* ((ret (geiser-eval-region (save-excursion (backward-sexp) (point))
- (point)
+ (let* (bosexp
+ (eosexp (save-excursion (backward-sexp)
+ (setq bosexp (point))
+ (forward-sexp)
+ (point)))
+ (ret (geiser-eval-region bosexp ;beginning of sexp
+ eosexp ;end of sexp
nil
t
print-to-buffer-p))