Function: princ
princ is a function defined in print.c.
Signature
(princ OBJECT &optional PRINTCHARFUN)
Documentation
Output the printed representation of OBJECT, any Lisp object.
No quoting characters are used; no delimiters are printed around the contents of strings.
OBJECT is any of the Lisp data types: a number, a string, a symbol, a list, a buffer, a window, a frame, etc.
A printed representation of an object is text which describes that object.
Optional argument PRINTCHARFUN is the output stream, which can be one of these:
- a buffer, in which case output is inserted into that buffer at point;
- a marker, in which case output is inserted at marker's position;
- a function, in which case that function is called once for each
character of OBJECT's printed representation;
- a symbol, in which case that symbol's function definition is called; or
- t, in which case the output is displayed in the echo area.
If PRINTCHARFUN is omitted, the value of standard-output (which see)
is used instead.
Probably introduced at or before Emacs version 17.
Source Code
// Defined in /usr/src/emacs/src/print.c
{
if (NILP (printcharfun))
printcharfun = Vstandard_output;
struct print_context pc = print_prepare (printcharfun);
if (STRINGP (object)
&& !string_intervals (object)
&& NILP (Vprint_continuous_numbering))
/* fast path for plain strings */
print_string (object, pc.printcharfun);
else
print (object, pc.printcharfun, 0);
print_finish (&pc);
return object;
}