This commit is contained in:
Kazu Yamamoto
2014-03-14 21:35:30 +09:00
parent 661f1a3813
commit 01298837e0
2 changed files with 10 additions and 9 deletions

View File

@@ -184,16 +184,17 @@
(defvar ghc-debug-buffer "*GHC Debug*")
(defmacro ghc-with-debug-buffer (&rest body)
`(with-current-buffer (set-buffer (get-buffer-create ghc-debug-buffer))
(goto-char (point-max))
,@body))
(defun ghc-call-process (cmd x y z &rest args)
(when ghc-debug
(with-current-buffer (set-buffer (get-buffer-create ghc-debug-buffer))
(goto-char (point-max))
(insert (format "%% %s %s\n" cmd (mapconcat 'identity args " ")))))
(apply 'call-process cmd x y z args)
(when ghc-debug
(let ((cbuf (current-buffer)))
(with-current-buffer (set-buffer (get-buffer-create ghc-debug-buffer))
(goto-char (point-max))
(insert-buffer-substring cbuf)))))
(ghc-with-debug-buffer
(insert (format "%% %s %s\n" cmd (mapconcat 'identity args " ")))
(insert-buffer-substring cbuf)))))
(provide 'ghc-func)