about summary refs log tree commit diff stats
path: root/lib/emit.scm
diff options
context:
space:
mode:
authorCase Duckworth2024-06-18 12:42:48 -0500
committerCase Duckworth2024-06-18 12:42:48 -0500
commitc30f5e0472f2463f475e6e4d4cf80341ab1e0e62 (patch)
tree5f74b174140c7ca9556d597c72166040fc2c0203 /lib/emit.scm
parentImplement verbatim piping (diff)
downloadjimmy-c30f5e0472f2463f475e6e4d4cf80341ab1e0e62.tar.gz
jimmy-c30f5e0472f2463f475e6e4d4cf80341ab1e0e62.zip
Fix verbatim processing fully
No more special-casing on the surface of the code; that is, the filter expects a list of strings and outputs a single string, etc.
Diffstat (limited to 'lib/emit.scm')
-rw-r--r--lib/emit.scm9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/emit.scm b/lib/emit.scm index 68912cf..6c0479c 100644 --- a/lib/emit.scm +++ b/lib/emit.scm
@@ -84,7 +84,7 @@
84 (printf (get-format 'verb 'stanza) 84 (printf (get-format 'verb 'stanza)
85 ((get-filter 'verb 'stanza) t))) 85 ((get-filter 'verb 'stanza) t)))
86 (let ((el (car stanza)) 86 (let ((el (car stanza))
87 (text (string-join (apply append (cdr stanza)) "\n"))) 87 (text (apply append (cdr stanza))))
88 (with-output-to-string 88 (with-output-to-string
89 (lambda () 89 (lambda ()
90 (cond 90 (cond
@@ -98,12 +98,13 @@
98 (process command (cdr cmdline) 98 (process command (cdr cmdline)
99 (cons `("JIMMY_OUTPUT" . ,(->string (output-type))) 99 (cons `("JIMMY_OUTPUT" . ,(->string (output-type)))
100 (get-environment-variables))) 100 (get-environment-variables)))
101 (display (ensure-newline text) out) 101 (display ((o ensure-newline (cut string-join <> "\n")) text)
102 out)
102 (close-output-port out) 103 (close-output-port out)
103 (display (read-string #f in)) 104 (display (read-string #f in))
104 (newline)) 105 (newline))
105 (emit-verbatim t)))) 106 (emit-verbatim text))))
106 (else (emit-verbatim t))))))) 107 (else (emit-verbatim text)))))))
107 108
108;;; Utilities 109;;; Utilities
109 110