diff options
Diffstat (limited to 'emacs/gds-scheme.el')
-rwxr-xr-x | emacs/gds-scheme.el | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/emacs/gds-scheme.el b/emacs/gds-scheme.el index b8a161b37..bb605c364 100755 --- a/emacs/gds-scheme.el +++ b/emacs/gds-scheme.el @@ -5,8 +5,7 @@ ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public ;;;; License as published by the Free Software Foundation; either -;;;; version 2.1 of the License, or (at your option) any later -;;;; version. +;;;; version 3 of the License, or (at your option) any later version. ;;;; ;;;; This library is distributed in the hope that it will be useful, ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -207,23 +206,28 @@ Emacs to display an error or trap so that the user can debug it." "-q" "--debug" "-c" - code)) - (client nil)) + code))) ;; Note that this process can be killed automatically on Emacs ;; exit. (process-kill-without-query proc) ;; Set up a process filter to catch the new client's number. (set-process-filter proc (lambda (proc string) - (setq client (string-to-number string)) (if (process-buffer proc) (with-current-buffer (process-buffer proc) - (insert string))))) + (insert string) + (or gds-client + (save-excursion + (goto-char (point-min)) + (setq gds-client + (condition-case nil + (read (current-buffer)) + (error nil))))))))) ;; Accept output from the new process until we have its number. - (while (not client) + (while (not (with-current-buffer (process-buffer proc) gds-client)) (accept-process-output proc)) ;; Return the new process's client number. - client)) + (with-current-buffer (process-buffer proc) gds-client))) ;;;; Evaluating code. |