Function: prin1
prin1 is a function defined in print.c.
Signature
(prin1 OBJECT &optional PRINTCHARFUN OVERRIDES)
Documentation
Output the printed representation of OBJECT, any Lisp object.
Quoting characters are printed when needed to make output that read
can handle, whenever this is possible. For complex objects, the behavior
is controlled by print-level and print-length, which see.
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.
Optional argument OVERRIDES should be a list of settings for print-related
variables. An element in this list can be the symbol t, which means "reset
all the values to their defaults". Otherwise, an element should be a pair,
where the car or the pair is the setting symbol, and the cdr is the
value of the setting to use for this prin1 call.
For instance:
(prin1 object nil '((length . 100) (circle . t))).
See Info node (elisp)Output Overrides for a list of possible values.
As a special case, OVERRIDES can also simply be the symbol t, which means "use default values for all the print-related settings".
Probably introduced at or before Emacs version 16.
Source Code
// Defined in /usr/src/emacs/src/print.c
{
specpdl_ref count = SPECPDL_INDEX ();
if (NILP (printcharfun))
printcharfun = Vstandard_output;
if (!NILP (overrides))
print_bind_overrides (overrides);
struct print_context pc = print_prepare (printcharfun);
print (object, pc.printcharfun, 1);
print_finish (&pc);
return unbind_to (count, object);
}