diff options
author | Diogo F. S. Ramos <dfsr@riseup.net> | 2017-04-11 12:42:24 -0300 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2017-04-11 19:21:30 +0200 |
commit | 41059d6295dbaa207b2203fb6b78003de4888714 (patch) | |
tree | b98dbd702a0acd44af2d49e02f2c89cb009318ab | |
parent | ac349b913616bea9c1b4f5a0f1ae06f2f83d7a20 (diff) | |
download | geiser-guile-41059d6295dbaa207b2203fb6b78003de4888714.tar.gz geiser-guile-41059d6295dbaa207b2203fb6b78003de4888714.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.
-rw-r--r-- | elisp/geiser-mode.el | 11 |
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) |