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 | ebad1fd4e47d87d2780ef29ed209f3cd0fed928c (patch) | |
tree | 6cea3c68df68106340b244fc23fbdce684ebb39c | |
parent | 6752fa5cd559e49449ccb03e53c8d19fda7afb4b (diff) | |
download | geiser-ebad1fd4e47d87d2780ef29ed209f3cd0fed928c.tar.gz geiser-ebad1fd4e47d87d2780ef29ed209f3cd0fed928c.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.
-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." |