From c0d316cce78b317b68dc3dc590256ef832721a2b Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Thu, 27 Aug 2009 22:22:34 +0100 Subject: Make GDS resilient to autocompilation comments * emacs/gds-scheme.el (gds-start-utility-guile): Make the extraction of client number more robust; in particular when the client emits comments (about auto compilation) before the number. --- emacs/gds-scheme.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/emacs/gds-scheme.el b/emacs/gds-scheme.el index 54c75a787..798b10702 100755 --- a/emacs/gds-scheme.el +++ b/emacs/gds-scheme.el @@ -214,10 +214,15 @@ Emacs to display an error or trap so that the user can debug it." ;; 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 client + (save-excursion + (goto-char (point-min)) + (setq client (condition-case nil + (read (current-buffer)) + (error nil))))))))) ;; Accept output from the new process until we have its number. (while (not client) (accept-process-output proc)) -- cgit v1.2.3