Function: terpri

terpri is a function defined in print.c.

Signature

(terpri &optional PRINTCHARFUN ENSURE)

Documentation

Output a newline to stream PRINTCHARFUN.

If ENSURE is non-nil only output a newline if not already at the beginning of a line. Value is non-nil if a newline is printed. If PRINTCHARFUN is omitted or nil, the value of standard-output is used.

View in manual

Probably introduced at or before Emacs version 25.1.

Source Code

// Defined in /usr/src/emacs/src/print.c
{
  Lisp_Object val;

  if (NILP (printcharfun))
    printcharfun = Vstandard_output;
  struct print_context pc = print_prepare (printcharfun);

  if (NILP (ensure))
    val = Qt;
  /* Difficult to check if at line beginning so abort.  */
  else if (FUNCTIONP (pc.printcharfun))
    signal_error ("Unsupported function argument", pc.printcharfun);
  else if (noninteractive && !NILP (pc.printcharfun))
    val = printchar_stdout_last == 10 ? Qnil : Qt;
  else
    val = NILP (Fbolp ()) ? Qt : Qnil;

  if (!NILP (val))
    printchar ('\n', pc.printcharfun);
  print_finish (&pc);
  return val;
}