diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-11-11 16:27:01 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-11-11 16:27:01 +0100 |
commit | ea8a2b3762f54ad2f6434b82a80d04228b478d1d (patch) | |
tree | 647d5db3e5944e1ce9a8f3233fdb3ccb2708a31c /elisp/geiser-inf.el | |
parent | 3fe2031aef30a9c9b29ef107947b32b6eb6d037e (diff) | |
download | geiser-ea8a2b3762f54ad2f6434b82a80d04228b478d1d.tar.gz geiser-ea8a2b3762f54ad2f6434b82a80d04228b478d1d.tar.bz2 |
Racket reconnected
Diffstat (limited to 'elisp/geiser-inf.el')
-rw-r--r-- | elisp/geiser-inf.el | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/elisp/geiser-inf.el b/elisp/geiser-inf.el index efe7e34..833850a 100644 --- a/elisp/geiser-inf.el +++ b/elisp/geiser-inf.el @@ -26,9 +26,10 @@ for this implementation.") "A function taking no arguments and returning a list of arguments to be used when invoking the scheme binary.") -(geiser-impl--define-caller geiser-inf--prompt-regexp prompt-regexp () +(geiser-impl--define-caller geiser-inf--prompt-re inferior-prompt-regexp () "A variable (or thunk returning a value) giving the regular -expression for this implementation's scheme prompt.") +expression for this implementation's inferior scheme prompt. By default, +cmuscheme's prompt regexp will be used.") (geiser-impl--define-caller geiser-inf--init-server-cmd init-server-cmd () "A variable (or thunk returning a value) giving the REPL server @@ -55,29 +56,34 @@ list of the form (server PORT).") (inferior-scheme-mode) (current-buffer))) +(defun geiser-inf--sentinel (proc evnt) + (let ((buff (process-buffer proc))) + (when (buffer-live-p buff) (kill-buffer buff)))) + ;; Starting an inferior REPL (defun geiser-inf--run-scheme (impl) (let ((bin (geiser-inf--binary impl)) (args (geiser-inf--arglist impl)) - (prompt-rx (geiser-inf--prompt-regexp impl))) - (unless (and bin args prompt-rx) + (prompt-rx (geiser-inf--prompt-re impl))) + (unless (and bin args) (error "Sorry, I don't know how to start %s" impl)) (with-current-buffer (geiser-inf--make-buffer impl) - (setq comint-prompt-regexp prompt-rx) + (when prompt-rx comint-prompt-regexp prompt-rx) (condition-case err (apply 'make-comint-in-buffer `(,(buffer-name) ,(current-buffer) ,bin nil ,@args)) - (error (error "Unable to start REPL: %s" (error-message-string err)))) + (error (error "Error starting inferior %s REPL: %s" + impl (error-message-string err)))) (geiser-inf--wait-for-prompt 10000) + (set-process-sentinel (get-buffer-process (current-buffer)) + 'geiser-inf--sentinel) (cons (current-buffer) (comint-redirect-results-list (geiser-inf--init-server-cmd impl) - "(server-port \\([0-9]\\)+)" + "(port \\([0-9]+\\))" 1))))) - - (provide 'geiser-inf) |