From f01d238cd4a402493e9617a785a9c920b1bc428c Mon Sep 17 00:00:00 2001 From: Jeremie Dimino Date: Thu, 28 Jul 2011 16:56:34 +0200 Subject: [PATCH] fix utop-process-output Ignore-this: b28611f674ea8d0425f1e645508d71a2 darcs-hash:20110728145634-c41ad-35a498f358ef63497f032295366f17c4fd8b4a4f --- src/utop.el | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/utop.el b/src/utop.el index 93fce9f..d90b6d0 100644 --- a/src/utop.el +++ b/src/utop.el @@ -236,19 +236,20 @@ non-sticky mode." (defun utop-process-output (process output) "Process the output of utop" - ;; Concatenate the output with the output not yet processed - (setq utop-output (concat utop-output output)) - ;; Split lines. Each line contains exactly one command - (let ((lines (split-string utop-output "\n"))) - (while (>= (length lines) 2) - ;; Process the first line - (utop-process-line (car lines)) - ;; Remove it and continue - (setq lines (cdr lines))) - ;; When the list contains only one element, then this is either - ;; the end of commands, either an unterminated one, so we save - ;; it for later - (setq utop-output (car lines)))) + (with-current-buffer utop-buffer-name + ;; Concatenate the output with the output not yet processed + (setq utop-output (concat utop-output output)) + ;; Split lines. Each line contains exactly one command + (let ((lines (split-string utop-output "\n"))) + (while (>= (length lines) 2) + ;; Process the first line + (utop-process-line (car lines)) + ;; Remove it and continue + (setq lines (cdr lines))) + ;; When the list contains only one element, then this is either + ;; the end of commands, either an unterminated one, so we save + ;; it for later + (setq utop-output (car lines))))) ;; +-----------------------------------------------------------------+ ;; | Sending data to the utop sub-process |