summaryrefslogtreecommitdiff
path: root/elisp/geiser-mode.el
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2017-11-22 04:01:45 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2017-11-22 04:01:45 +0100
commit0be9384a6812343b82a01c1af3a45b677a0a12be (patch)
tree45cd4c61f176c8d12931bf844aed7cfeaaeb16bf /elisp/geiser-mode.el
parentd3c04723c57515c6bca0ed4caae85c69a52c9cd5 (diff)
downloadgeiser-0be9384a6812343b82a01c1af3a45b677a0a12be.tar.gz
geiser-0be9384a6812343b82a01c1af3a45b677a0a12be.tar.bz2
Theoretically unnecessary save-excursion
For some reason, one of our users is experiencing point jumps when calling `geiser-set-scheme'. A save-excursion is all that's needed, even though it *shouldn't* be needed in the first place.
Diffstat (limited to 'elisp/geiser-mode.el')
-rw-r--r--elisp/geiser-mode.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/elisp/geiser-mode.el b/elisp/geiser-mode.el
index 229c3ea..9a28b02 100644
--- a/elisp/geiser-mode.el
+++ b/elisp/geiser-mode.el
@@ -238,12 +238,13 @@ With prefix, recursively macro-expand the resulting expression."
(defun geiser-set-scheme ()
"Associates current buffer with a given Scheme implementation."
(interactive)
- (geiser-syntax--remove-kws)
- (let ((impl (geiser-impl--read-impl)))
- (geiser-impl--set-buffer-implementation impl)
- (geiser-repl--set-up-repl impl)
- (geiser-syntax--add-kws)
- (geiser-syntax--fontify)))
+ (save-excursion
+ (geiser-syntax--remove-kws)
+ (let ((impl (geiser-impl--read-impl)))
+ (geiser-impl--set-buffer-implementation impl)
+ (geiser-repl--set-up-repl impl)
+ (geiser-syntax--add-kws)
+ (geiser-syntax--fontify))))
(defun geiser-mode-switch-to-repl (arg)
"Switches to Geiser REPL.