diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-10-16 22:12:05 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-10-16 23:28:34 +0200 |
commit | dd42ab03ba60948ec676e61d97b54167a1787f5b (patch) | |
tree | 639386cce10780256105b0166e282d2e307162d6 | |
parent | Better error handling when submitting events. (diff) | |
download | calp-dd42ab03ba60948ec676e61d97b54167a1787f5b.tar.gz calp-dd42ab03ba60948ec676e61d97b54167a1787f5b.tar.xz |
Truncate print for spawned repl.
Having this as the default allows the representation of vcomponents to
not contain a newline. Otherwise accidentaly printing everything was a
sure fire way to hang emacs.
-rw-r--r-- | module/calp/repl.scm | 9 | ||||
-rw-r--r-- | module/vcomponent/base.scm | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/module/calp/repl.scm b/module/calp/repl.scm index b0281f07..327ee206 100644 --- a/module/calp/repl.scm +++ b/module/calp/repl.scm @@ -4,6 +4,8 @@ (define-module (calp repl) :use-module (system repl server) + :use-module ((system repl common) :select (repl-default-option-set!)) + :use-module ((ice-9 pretty-print) :select (truncated-print)) :use-module (ice-9 regex) :use-module (ice-9 format) :use-module ((calp util hooks) :select (shutdown-hook)) @@ -37,7 +39,12 @@ ;; currently impossible [(IPv6) (error (G_ "How did you get here?"))])) - ;; TODO setup repl environment here + (repl-default-option-set! + 'print + (lambda (repl obj) + (truncated-print obj) + (newline))) + ;; TODO setup repl environment here ) diff --git a/module/vcomponent/base.scm b/module/vcomponent/base.scm index b62d45c2..df452f62 100644 --- a/module/vcomponent/base.scm +++ b/module/vcomponent/base.scm @@ -85,7 +85,7 @@ ((@ (srfi srfi-9 gnu) set-record-type-printer!) <vcomponent> (lambda (c p) - (format p "#<<vcomponent> ~a, len(child)=~a, parent=~a>~%" + (format p "#<<vcomponent> ~a, len(child)=~a, parent=~a>" (type c) (length (children c)) (and=> (get-component-parent c) type)))) |