summaryrefslogtreecommitdiff
path: root/elisp/geiser-mode.el
diff options
context:
space:
mode:
authorDiogo F. S. Ramos <dfsr@riseup.net>2017-04-11 12:42:24 -0300
committerJose Antonio Ortega Ruiz <jao@gnu.org>2017-04-11 19:21:30 +0200
commitbffaaae6d2e752d2e6844e7f590945f4d54ea31a (patch)
treec349a877c73bbf334a97ef23e67c6c8cedc4321e /elisp/geiser-mode.el
parent2834cd900779ad8966bc997f1a5c65122bbe3a63 (diff)
downloadgeiser-bffaaae6d2e752d2e6844e7f590945f4d54ea31a.tar.gz
geiser-bffaaae6d2e752d2e6844e7f590945f4d54ea31a.tar.bz2
Preserve the position of (point) after evaling
After evaling the last expression, if not inserting its value into buffer, leave (point) at its original position.
Diffstat (limited to 'elisp/geiser-mode.el')
-rw-r--r--elisp/geiser-mode.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/elisp/geiser-mode.el b/elisp/geiser-mode.el
index b5c2029..0d00662 100644
--- a/elisp/geiser-mode.el
+++ b/elisp/geiser-mode.el
@@ -149,11 +149,12 @@ With a prefix, revert the effect of `geiser-mode-eval-last-sexp-to-buffer' "
(setq bosexp (point))
(forward-sexp)
(point)))
- (ret (geiser-eval-region bosexp ;beginning of sexp
- eosexp ;end of sexp
- nil
- t
- print-to-buffer-p))
+ (ret (save-excursion
+ (geiser-eval-region bosexp ;beginning of sexp
+ eosexp ;end of sexp
+ nil
+ t
+ print-to-buffer-p)))
(err (geiser-eval--retort-error ret))
(will-eval-to-buffer (if print-to-buffer-p
(not geiser-mode-eval-last-sexp-to-buffer)