I try 2 inline Elisp script.
$ emacs --batch -q --eval="(dolist (elm (list 1 2 3 4 5)) (princ (format \"%s, \" elm)) (sit-for 1))"
1, 2, 3, 4, 5,
$ emacs --batch -q --eval="(dolist (elm (list 1 2 3 4 5)) (princ (format \"%s, \\n\" elm)) (sit-for 1))"
1,
2,
3,
4,
5,
The former is output all at once with buffering, while the latter is output gradually every second. It seems that output buffering is done using line feed as a trigger. Is there a way to output without buffering in the former case?
I'm using Emacs-27.1.