diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2013-04-11 07:16:17 +0200 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2013-04-11 07:16:17 +0200 |
commit | 2f48c7955f48b07d0aa656267b6b9954077626e0 (patch) | |
tree | 6a2ef834d21d671d10bd3067544084fe187199bb /elisp/geiser-repl.el | |
parent | 059025eeae73f2b91e2db157b3aa84c91f50f422 (diff) | |
download | geiser-2f48c7955f48b07d0aa656267b6b9954077626e0.tar.gz geiser-2f48c7955f48b07d0aa656267b6b9954077626e0.tar.bz2 |
New flag to automatically start REPLs when geiser-mode is activated
When no live REPL is found, of course. The flag's imaginatively
called geiser-mode-start-repl-p.
Diffstat (limited to 'elisp/geiser-repl.el')
-rw-r--r-- | elisp/geiser-repl.el | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el index 0b4fe54..1d1b317 100644 --- a/elisp/geiser-repl.el +++ b/elisp/geiser-repl.el @@ -376,12 +376,15 @@ module command as a string") (overlay-end comint-last-prompt-overlay) t))))) -(defun geiser-repl--connection () +(defun geiser-repl--connection* () (let ((buffer (geiser-repl--set-up-repl geiser-impl--implementation))) - (or (and (buffer-live-p buffer) - (get-buffer-process buffer) - (with-current-buffer buffer geiser-repl--connection)) - (error "No Geiser REPL for this buffer (try M-x run-geiser)")))) + (and (buffer-live-p buffer) + (get-buffer-process buffer) + (with-current-buffer buffer geiser-repl--connection)))) + +(defun geiser-repl--connection () + (or (geiser-repl--connection*) + (error "No Geiser REPL for this buffer (try M-x run-geiser)"))) (setq geiser-eval--default-connection-function 'geiser-repl--connection) @@ -677,6 +680,7 @@ 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. If no REPL is running, execute `run-geiser' to start a fresh one." (interactive "P") |