From: Mark Wooding Date: Sun, 30 Aug 2015 09:58:38 +0000 (+0100) Subject: src/debug.lisp: Write output to a well-known file. X-Git-Tag: 0.2.0~25 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/sod/commitdiff_plain/76618d28a01b4b65b530ac032372f2b22ad08d5d src/debug.lisp: Write output to a well-known file. This way, Emacs can display it properly fontified in a buffer, and refresh when it gets changed, rather than having an enormous dump of text in the middle of a REPL session. --- diff --git a/src/debug.lisp b/src/debug.lisp index e281397..af5f104 100644 --- a/src/debug.lisp +++ b/src/debug.lisp @@ -25,6 +25,9 @@ (cl:in-package #:sod) +(export '*debugout-pathname*) +(defvar *debugout-pathname* #p"debugout.c") + (export 'test-module) (defun test-module (path reason) "Reset the translator's state, read a module from PATH and output it with @@ -32,7 +35,10 @@ (defun test-module (path reason) (unless *builtin-module* (make-builtin-module)) (clear-the-decks) (setf *module-map* (make-hash-table :test #'equal)) - (with-output-to-string (out) + (with-open-file (out *debugout-pathname* + :direction :output + :if-exists :supersede + :if-does-not-exist :create) (output-module (read-module path) reason out))) ;;;----- That's all, folks --------------------------------------------------