splitting stdout and stderr.
This commit is contained in:
parent
54c2be20b6
commit
002008aa30
@ -21,7 +21,9 @@
|
|||||||
(defvar-local ghc-process-hook nil)
|
(defvar-local ghc-process-hook nil)
|
||||||
(defvar-local ghc-process-root nil)
|
(defvar-local ghc-process-root nil)
|
||||||
|
|
||||||
(defvar ghc-command "ghc-mod")
|
(defvar ghc-command "Mock")
|
||||||
|
|
||||||
|
(defvar ghc-error-buffer "*GHC Error*")
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
@ -74,15 +76,46 @@
|
|||||||
pro))
|
pro))
|
||||||
|
|
||||||
(defun ghc-process-filter (process string)
|
(defun ghc-process-filter (process string)
|
||||||
(let ((pbuf (process-buffer process)))
|
(let* ((pbuf (process-buffer process))
|
||||||
|
(tbufname (concat " tmp " (buffer-name pbuf)))
|
||||||
|
tbuf)
|
||||||
(if (not (get-buffer pbuf))
|
(if (not (get-buffer pbuf))
|
||||||
(setq ghc-process-running nil) ;; just in case
|
(setq ghc-process-running nil) ;; just in case
|
||||||
(ghc-with-current-buffer (process-buffer process)
|
(ghc-with-current-buffer pbuf
|
||||||
(when ghc-debug
|
(when ghc-debug
|
||||||
(ghc-with-debug-buffer
|
(ghc-with-debug-buffer
|
||||||
(insert string)))
|
(insert string)))
|
||||||
(goto-char (point-max))
|
(with-current-buffer (get-buffer-create tbufname)
|
||||||
(insert string)
|
(setq tbuf (current-buffer))
|
||||||
|
(goto-char (point-max))
|
||||||
|
(insert string)
|
||||||
|
(goto-char (point-min))
|
||||||
|
(let ((cont t) end out)
|
||||||
|
(while (and cont (not (eobp)))
|
||||||
|
(cond
|
||||||
|
((looking-at "^O: ")
|
||||||
|
(setq out t))
|
||||||
|
((looking-at "^E: ")
|
||||||
|
(setq out nil))
|
||||||
|
(t
|
||||||
|
(setq cont nil)))
|
||||||
|
(when cont
|
||||||
|
(forward-line)
|
||||||
|
(unless (bolp) (setq cont nil)))
|
||||||
|
(when cont
|
||||||
|
(delete-region 1 4)
|
||||||
|
(setq end (point))
|
||||||
|
(if out
|
||||||
|
(with-current-buffer pbuf
|
||||||
|
(goto-char (point-max))
|
||||||
|
(insert-buffer-substring tbuf 1 end))
|
||||||
|
(with-current-buffer (get-buffer-create ghc-error-buffer)
|
||||||
|
(goto-char (point-max))
|
||||||
|
(insert-buffer-substring tbuf 1 end)
|
||||||
|
(display-buffer (current-buffer))
|
||||||
|
(redisplay)))
|
||||||
|
(delete-region 1 end)))))
|
||||||
|
(goto-char (point-max))
|
||||||
(forward-line -1)
|
(forward-line -1)
|
||||||
(cond
|
(cond
|
||||||
((looking-at "^OK$")
|
((looking-at "^OK$")
|
||||||
|
Loading…
Reference in New Issue
Block a user