diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2011-09-08 23:15:36 +0200 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2011-09-08 23:15:36 +0200 |
commit | ffd2cea60f6e7d8d0cf9a1fda6912b2003b92855 (patch) | |
tree | 0373cf5dba20305a604b01057d8f5ee225a354f7 /elisp/geiser-repl.el | |
parent | d708438236cac2ee3c0a63f06eded5d9a6f38a9f (diff) | |
download | geiser-chez-ffd2cea60f6e7d8d0cf9a1fda6912b2003b92855.tar.gz geiser-chez-ffd2cea60f6e7d8d0cf9a1fda6912b2003b92855.tar.bz2 |
bug fix: make C-c C-z behave with run-geiser
The nice go-back-to-previous-scheme-buffer behaviour of C-c C-z wasn't
working when the jump from a scheme file to the REPL was initiated via
run-geiser. Thanks, Marijn.
Diffstat (limited to 'elisp/geiser-repl.el')
-rw-r--r-- | elisp/geiser-repl.el | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el index d2249ae..7ffd1be 100644 --- a/elisp/geiser-repl.el +++ b/elisp/geiser-repl.el @@ -598,7 +598,9 @@ buffer." "Start a new Geiser REPL." (interactive (list (geiser-repl--get-impl "Start Geiser for scheme implementation: "))) - (geiser-repl--start-repl impl nil)) + (let ((buffer (current-buffer))) + (geiser-repl--start-repl impl nil) + (geiser-repl--maybe-remember-scm-buffer buffer))) (defalias 'geiser 'run-geiser) @@ -606,12 +608,20 @@ buffer." "Start a new Geiser REPL connected to a remote Scheme process." (interactive (list (geiser-repl--get-impl "Connect to Scheme implementation: "))) - (geiser-repl--start-repl impl - (geiser-repl--read-address host port))) + (let ((buffer (current-buffer))) + (geiser-repl--start-repl impl + (geiser-repl--read-address host port)) + (geiser-repl--maybe-remember-scm-buffer buffer))) (make-variable-buffer-local (defvar geiser-repl--last-scm-buffer nil)) +(defun geiser-repl--maybe-remember-scm-buffer (buffer) + (when (and buffer + (eq 'scheme-mode (with-current-buffer buffer major-mode)) + (eq major-mode 'geiser-repl-mode)) + (setq geiser-repl--last-scm-buffer buffer))) + (defun switch-to-geiser (&optional ask impl buffer) "Switch to running Geiser REPL. With prefix argument, ask for which one if more than one is running. @@ -635,8 +645,7 @@ If no REPL is running, execute `run-geiser' to start a fresh one." (repl (geiser-repl--switch-to-buffer repl)) ((geiser-repl--remote-p) (geiser-connect impl)) (t (run-geiser impl))) - (when (and buffer (eq major-mode 'geiser-repl-mode)) - (setq geiser-repl--last-scm-buffer buffer)))) + (geiser-repl--maybe-remember-scm-buffer buffer))) (defun switch-to-geiser-module (&optional module buffer) "Switch to running Geiser REPL and try to enter a given module." |