fix utop-process-output

Ignore-this: b28611f674ea8d0425f1e645508d71a2

darcs-hash:20110728145634-c41ad-35a498f358ef63497f032295366f17c4fd8b4a4f
This commit is contained in:
Jeremie Dimino 2011-07-28 16:56:34 +02:00
parent 7c645d9c69
commit f01d238cd4
1 changed files with 14 additions and 13 deletions

View File

@ -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 |