external filter
Posted: Wed Jan 30, 2013 4:19 am
What is a more idiomatic way to do this? :
It feels dirty to use a /tmp/file like that. Ideally I'd like to pipe a string through `/bin/fmt` capturing its STDOUT, all within newlisp.
Code: Select all
(set 'tmp-file (open "/tmp/file" "write"))
(write tmp-file (join (map markup (parse pretext "\n" 0)) "\n"))
(close tmp-file)
(setf posttext (join (exec "fmt -68 /tmp/file") "\n"))