* doc/lispref/streams.texi (Output Functions): Document it.
* src/print.c (Fflush_standard_output): New function (bug#15180).
@var{character}.
@end defun
+@defun flush-standard-output
+If you have Emacs-based batch scripts that send output to the
+terminal, Emacs will automatically display the output whenever you
+write a newline characters to @code{standard-output}. This function
+allows you to flush to @code{standard-output} without sending a
+newline character first, which enables you to display incomplete
+lines.
+@end defun
+
@defun prin1-to-string object &optional noescape
@cindex object to string
This function returns a string containing the text that @code{prin1}
\f
* Lisp Changes in Emacs 29.1
++++
+** New function 'flush-standard-output'.
+This enables you do display incomplete lines from batch-based Emacs
+scripts.
+
+++
** New convenience function 'buttonize-region'.
This works like 'buttonize', but for a region instead of a string.
return object;
}
+DEFUN ("flush-standard-output", Fflush_standard_output, Sflush_standard_output,
+ 0, 0, 0,
+ doc: /* Flush standard-output.
+This can be useful after using `princ' and the like in scripts. */)
+ (void)
+{
+ fflush (stdout);
+ return Qnil;
+}
+
DEFUN ("external-debugging-output", Fexternal_debugging_output, Sexternal_debugging_output, 1, 1, 0,
doc: /* Write CHARACTER to stderr.
You can call `print' while debugging emacs, and pass it this function
be printed. */);
Vprint_unreadable_function = Qnil;
DEFSYM (Qprint_unreadable_function, "print-unreadable-function");
+
+ defsubr (&Sflush_standard_output);
}