1 /* Lisp object printing and output streams.
2 Copyright (C) 1985, 1986, 1988, 1993 Free Software Foundation, Inc.
4 This file is part of GNU Emacs.
6 GNU Emacs is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU Emacs is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Emacs; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
31 #include "dispextern.h"
33 #endif /* not standalone */
35 #ifdef USE_TEXT_PROPERTIES
36 #include "intervals.h"
39 Lisp_Object Vstandard_output
, Qstandard_output
;
41 #ifdef LISP_FLOAT_TYPE
42 Lisp_Object Vfloat_output_format
, Qfloat_output_format
;
43 #endif /* LISP_FLOAT_TYPE */
45 /* Avoid actual stack overflow in print. */
48 /* Detect most circularities to print finite output. */
49 #define PRINT_CIRCLE 200
50 Lisp_Object being_printed
[PRINT_CIRCLE
];
52 /* Maximum length of list to print in full; noninteger means
53 effectively infinity */
55 Lisp_Object Vprint_length
;
57 /* Maximum depth of list to print in full; noninteger means
58 effectively infinity. */
60 Lisp_Object Vprint_level
;
62 /* Nonzero means print newlines in strings as \n. */
64 int print_escape_newlines
;
66 Lisp_Object Qprint_escape_newlines
;
68 /* Nonzero means print newline before next minibuffer message.
71 extern int noninteractive_need_newline
;
72 #ifdef MAX_PRINT_CHARS
73 static int print_chars
;
75 #endif /* MAX_PRINT_CHARS */
77 void print_interval ();
80 /* Convert between chars and GLYPHs */
84 register GLYPH
*glyphs
;
94 str_to_glyph_cpy (str
, glyphs
)
98 register GLYPH
*gp
= glyphs
;
99 register char *cp
= str
;
106 str_to_glyph_ncpy (str
, glyphs
, n
)
111 register GLYPH
*gp
= glyphs
;
112 register char *cp
= str
;
119 glyph_to_str_cpy (glyphs
, str
)
123 register GLYPH
*gp
= glyphs
;
124 register char *cp
= str
;
127 *str
++ = *gp
++ & 0377;
131 /* Low level output routines for charaters and strings */
133 /* Lisp functions to do output using a stream
134 must have the stream in a variable called printcharfun
135 and must start with PRINTPREPARE and end with PRINTFINISH.
136 Use PRINTCHAR to output one character,
137 or call strout to output a block of characters.
138 Also, each one must have the declarations
139 struct buffer *old = current_buffer;
140 int old_point = -1, start_point;
141 Lisp_Object original;
144 #define PRINTPREPARE \
145 original = printcharfun; \
146 if (NILP (printcharfun)) printcharfun = Qt; \
147 if (XTYPE (printcharfun) == Lisp_Buffer) \
148 { if (XBUFFER (printcharfun) != current_buffer) Fset_buffer (printcharfun); \
149 printcharfun = Qnil;}\
150 if (XTYPE (printcharfun) == Lisp_Marker) \
151 { if (XMARKER (original)->buffer != current_buffer) \
152 set_buffer_internal (XMARKER (original)->buffer); \
154 SET_PT (marker_position (printcharfun)); \
155 start_point = point; \
156 printcharfun = Qnil;}
158 #define PRINTFINISH \
159 if (XTYPE (original) == Lisp_Marker) \
160 Fset_marker (original, make_number (point), Qnil); \
161 if (old_point >= 0) \
162 SET_PT ((old_point >= start_point ? point - start_point : 0) + old_point); \
163 if (old != current_buffer) \
164 set_buffer_internal (old)
166 #define PRINTCHAR(ch) printchar (ch, printcharfun)
168 /* Index of first unused element of FRAME_MESSAGE_BUF(selected_frame). */
169 static int printbufidx
;
178 #ifdef MAX_PRINT_CHARS
181 #endif /* MAX_PRINT_CHARS */
195 noninteractive_need_newline
= 1;
199 if (echo_area_glyphs
!= FRAME_MESSAGE_BUF (selected_frame
)
200 || !message_buf_print
)
202 echo_area_glyphs
= FRAME_MESSAGE_BUF (selected_frame
);
204 message_buf_print
= 1;
207 if (printbufidx
< FRAME_WIDTH (selected_frame
) - 1)
208 FRAME_MESSAGE_BUF (selected_frame
)[printbufidx
++] = ch
;
209 FRAME_MESSAGE_BUF (selected_frame
)[printbufidx
] = 0;
213 #endif /* not standalone */
220 strout (ptr
, size
, printcharfun
)
223 Lisp_Object printcharfun
;
227 if (EQ (printcharfun
, Qnil
))
229 insert (ptr
, size
>= 0 ? size
: strlen (ptr
));
230 #ifdef MAX_PRINT_CHARS
232 print_chars
+= size
>= 0 ? size
: strlen(ptr
);
233 #endif /* MAX_PRINT_CHARS */
236 if (EQ (printcharfun
, Qt
))
238 i
= size
>= 0 ? size
: strlen (ptr
);
239 #ifdef MAX_PRINT_CHARS
242 #endif /* MAX_PRINT_CHARS */
246 fwrite (ptr
, 1, i
, stdout
);
247 noninteractive_need_newline
= 1;
251 if (echo_area_glyphs
!= FRAME_MESSAGE_BUF (selected_frame
)
252 || !message_buf_print
)
254 echo_area_glyphs
= FRAME_MESSAGE_BUF (selected_frame
);
256 message_buf_print
= 1;
259 if (i
> FRAME_WIDTH (selected_frame
) - printbufidx
- 1)
260 i
= FRAME_WIDTH (selected_frame
) - printbufidx
- 1;
261 bcopy (ptr
, &FRAME_MESSAGE_BUF (selected_frame
) [printbufidx
], i
);
263 FRAME_MESSAGE_BUF (selected_frame
) [printbufidx
] = 0;
270 PRINTCHAR (ptr
[i
++]);
273 PRINTCHAR (ptr
[i
++]);
276 /* Print the contents of a string STRING using PRINTCHARFUN.
277 It isn't safe to use strout, because printing one char can relocate. */
279 print_string (string
, printcharfun
)
281 Lisp_Object printcharfun
;
283 if (EQ (printcharfun
, Qnil
) || EQ (printcharfun
, Qt
))
284 /* In predictable cases, strout is safe: output to buffer or frame. */
285 strout (XSTRING (string
)->data
, XSTRING (string
)->size
, printcharfun
);
288 /* Otherwise, fetch the string address for each character. */
290 int size
= XSTRING (string
)->size
;
293 for (i
= 0; i
< size
; i
++)
294 PRINTCHAR (XSTRING (string
)->data
[i
]);
299 DEFUN ("write-char", Fwrite_char
, Swrite_char
, 1, 2, 0,
300 "Output character CHAR to stream STREAM.\n\
301 STREAM defaults to the value of `standard-output' (which see).")
303 Lisp_Object ch
, printcharfun
;
305 struct buffer
*old
= current_buffer
;
308 Lisp_Object original
;
310 if (NILP (printcharfun
))
311 printcharfun
= Vstandard_output
;
312 CHECK_NUMBER (ch
, 0);
314 PRINTCHAR (XINT (ch
));
319 /* Used from outside of print.c to print a block of SIZE chars at DATA
320 on the default output stream.
321 Do not use this on the contents of a Lisp string. */
323 write_string (data
, size
)
327 struct buffer
*old
= current_buffer
;
328 Lisp_Object printcharfun
;
331 Lisp_Object original
;
333 printcharfun
= Vstandard_output
;
336 strout (data
, size
, printcharfun
);
340 /* Used from outside of print.c to print a block of SIZE chars at DATA
341 on a specified stream PRINTCHARFUN.
342 Do not use this on the contents of a Lisp string. */
344 write_string_1 (data
, size
, printcharfun
)
347 Lisp_Object printcharfun
;
349 struct buffer
*old
= current_buffer
;
352 Lisp_Object original
;
355 strout (data
, size
, printcharfun
);
363 temp_output_buffer_setup (bufname
)
366 register struct buffer
*old
= current_buffer
;
367 register Lisp_Object buf
;
369 Fset_buffer (Fget_buffer_create (build_string (bufname
)));
371 current_buffer
->read_only
= Qnil
;
374 XSET (buf
, Lisp_Buffer
, current_buffer
);
375 specbind (Qstandard_output
, buf
);
377 set_buffer_internal (old
);
381 internal_with_output_to_temp_buffer (bufname
, function
, args
)
383 Lisp_Object (*function
) ();
386 int count
= specpdl_ptr
- specpdl
;
387 Lisp_Object buf
, val
;
389 record_unwind_protect (Fset_buffer
, Fcurrent_buffer ());
390 temp_output_buffer_setup (bufname
);
391 buf
= Vstandard_output
;
393 val
= (*function
) (args
);
395 temp_output_buffer_show (buf
);
397 return unbind_to (count
, val
);
400 DEFUN ("with-output-to-temp-buffer", Fwith_output_to_temp_buffer
, Swith_output_to_temp_buffer
,
402 "Bind `standard-output' to buffer BUFNAME, eval BODY, then show that buffer.\n\
403 The buffer is cleared out initially, and marked as unmodified when done.\n\
404 All output done by BODY is inserted in that buffer by default.\n\
405 The buffer is displayed in another window, but not selected.\n\
406 The value of the last form in BODY is returned.\n\
407 If BODY does not finish normally, the buffer BUFNAME is not displayed.\n\n\
408 If variable `temp-buffer-show-hook' is non-nil, call it at the end\n\
409 to get the buffer displayed. It gets one argument, the buffer to display.")
415 int count
= specpdl_ptr
- specpdl
;
416 Lisp_Object buf
, val
;
419 name
= Feval (Fcar (args
));
422 CHECK_STRING (name
, 0);
423 temp_output_buffer_setup (XSTRING (name
)->data
);
424 buf
= Vstandard_output
;
426 val
= Fprogn (Fcdr (args
));
428 temp_output_buffer_show (buf
);
430 return unbind_to (count
, val
);
432 #endif /* not standalone */
434 static void print ();
436 DEFUN ("terpri", Fterpri
, Sterpri
, 0, 1, 0,
437 "Output a newline to STREAM.\n\
438 If STREAM is omitted or nil, the value of `standard-output' is used.")
440 Lisp_Object printcharfun
;
442 struct buffer
*old
= current_buffer
;
445 Lisp_Object original
;
447 if (NILP (printcharfun
))
448 printcharfun
= Vstandard_output
;
455 DEFUN ("prin1", Fprin1
, Sprin1
, 1, 2, 0,
456 "Output the printed representation of OBJECT, any Lisp object.\n\
457 Quoting characters are printed when needed to make output that `read'\n\
458 can handle, whenever this is possible.\n\
459 Output stream is STREAM, or value of `standard-output' (which see).")
461 Lisp_Object obj
, printcharfun
;
463 struct buffer
*old
= current_buffer
;
466 Lisp_Object original
;
468 #ifdef MAX_PRINT_CHARS
470 #endif /* MAX_PRINT_CHARS */
471 if (NILP (printcharfun
))
472 printcharfun
= Vstandard_output
;
475 print (obj
, printcharfun
, 1);
480 /* a buffer which is used to hold output being built by prin1-to-string */
481 Lisp_Object Vprin1_to_string_buffer
;
483 DEFUN ("prin1-to-string", Fprin1_to_string
, Sprin1_to_string
, 1, 2, 0,
484 "Return a string containing the printed representation of OBJECT,\n\
485 any Lisp object. Quoting characters are used when needed to make output\n\
486 that `read' can handle, whenever this is possible, unless the optional\n\
487 second argument NOESCAPE is non-nil.")
489 Lisp_Object obj
, noescape
;
491 struct buffer
*old
= current_buffer
;
494 Lisp_Object original
, printcharfun
;
497 printcharfun
= Vprin1_to_string_buffer
;
500 print (obj
, printcharfun
, NILP (noescape
));
501 /* Make Vprin1_to_string_buffer be the default buffer after PRINTFINSH */
503 set_buffer_internal (XBUFFER (Vprin1_to_string_buffer
));
504 obj
= Fbuffer_string ();
508 set_buffer_internal (old
);
514 DEFUN ("princ", Fprinc
, Sprinc
, 1, 2, 0,
515 "Output the printed representation of OBJECT, any Lisp object.\n\
516 No quoting characters are used; no delimiters are printed around\n\
517 the contents of strings.\n\
518 Output stream is STREAM, or value of standard-output (which see).")
520 Lisp_Object obj
, printcharfun
;
522 struct buffer
*old
= current_buffer
;
525 Lisp_Object original
;
527 if (NILP (printcharfun
))
528 printcharfun
= Vstandard_output
;
531 print (obj
, printcharfun
, 0);
536 DEFUN ("print", Fprint
, Sprint
, 1, 2, 0,
537 "Output the printed representation of OBJECT, with newlines around it.\n\
538 Quoting characters are printed when needed to make output that `read'\n\
539 can handle, whenever this is possible.\n\
540 Output stream is STREAM, or value of `standard-output' (which see).")
542 Lisp_Object obj
, printcharfun
;
544 struct buffer
*old
= current_buffer
;
547 Lisp_Object original
;
550 #ifdef MAX_PRINT_CHARS
552 max_print
= MAX_PRINT_CHARS
;
553 #endif /* MAX_PRINT_CHARS */
554 if (NILP (printcharfun
))
555 printcharfun
= Vstandard_output
;
560 print (obj
, printcharfun
, 1);
563 #ifdef MAX_PRINT_CHARS
566 #endif /* MAX_PRINT_CHARS */
571 /* The subroutine object for external-debugging-output is kept here
572 for the convenience of the debugger. */
573 Lisp_Object Qexternal_debugging_output
;
575 DEFUN ("external-debugging-output", Fexternal_debugging_output
, Sexternal_debugging_output
, 1, 1, 0,
576 "Write CHARACTER to stderr.\n\
577 You can call print while debugging emacs, and pass it this function\n\
578 to make it write to the debugging output.\n")
580 Lisp_Object character
;
582 CHECK_NUMBER (character
, 0);
583 putc (XINT (character
), stderr
);
588 #ifdef LISP_FLOAT_TYPE
591 * The buffer should be at least as large as the max string size of the
592 * largest float, printed in the biggest notation. This is undoubtably
593 * 20d float_output_format, with the negative of the C-constant "HUGE"
596 * On the vax the worst case is -1e38 in 20d format which takes 61 bytes.
598 * I assume that IEEE-754 format numbers can take 329 bytes for the worst
599 * case of -1e307 in 20d float_output_format. What is one to do (short of
600 * re-writing _doprnt to be more sane)?
605 float_to_string (buf
, data
)
609 register unsigned char *cp
, c
;
612 if (NILP (Vfloat_output_format
)
613 || XTYPE (Vfloat_output_format
) != Lisp_String
)
615 sprintf (buf
, "%.20g", data
);
618 /* Check that the spec we have is fully valid.
619 This means not only valid for printf,
620 but meant for floats, and reasonable. */
621 cp
= XSTRING (Vfloat_output_format
)->data
;
630 ((c
= *cp
) >= '0' && c
<= '9');
637 if (*cp
!= 'e' && *cp
!= 'f' && *cp
!= 'g')
640 if (width
< (*cp
!= 'e') || width
> DBL_DIG
)
646 sprintf (buf
, XSTRING (Vfloat_output_format
)->data
, data
);
649 /* Make sure there is a decimal point with digit after, or an exponent,
650 so that the value is readable as a float. */
651 for (cp
= buf
; *cp
; cp
++)
652 if (*cp
< '0' || *cp
> '9')
655 if (*cp
== '.' && cp
[1] == 0)
668 #endif /* LISP_FLOAT_TYPE */
671 print (obj
, printcharfun
, escapeflag
)
673 register Lisp_Object printcharfun
;
680 #if 1 /* I'm not sure this is really worth doing. */
681 /* Detect circularities and truncate them.
682 No need to offer any alternative--this is better than an error. */
683 if (XTYPE (obj
) == Lisp_Cons
|| XTYPE (obj
) == Lisp_Vector
684 || XTYPE (obj
) == Lisp_Compiled
)
687 for (i
= 0; i
< print_depth
; i
++)
688 if (EQ (obj
, being_printed
[i
]))
690 sprintf (buf
, "#%d", i
);
691 strout (buf
, -1, printcharfun
);
697 being_printed
[print_depth
] = obj
;
700 if (print_depth
> PRINT_CIRCLE
)
701 error ("Apparently circular structure being printed");
702 #ifdef MAX_PRINT_CHARS
703 if (max_print
&& print_chars
> max_print
)
708 #endif /* MAX_PRINT_CHARS */
710 #ifdef SWITCH_ENUM_BUG
711 switch ((int) XTYPE (obj
))
717 /* We're in trouble if this happens!
718 Probably should just abort () */
719 strout ("#<EMACS BUG: INVALID DATATYPE ", -1, printcharfun
);
720 sprintf (buf
, "(#o%3o)", (int) XTYPE (obj
));
721 strout (buf
, -1, printcharfun
);
722 strout (" Save your buffers immediately and please report this bug>",
726 #ifdef LISP_FLOAT_TYPE
729 char pigbuf
[350]; /* see comments in float_to_string */
731 float_to_string (pigbuf
, XFLOAT(obj
)->data
);
732 strout (pigbuf
, -1, printcharfun
);
735 #endif /* LISP_FLOAT_TYPE */
738 sprintf (buf
, "%d", XINT (obj
));
739 strout (buf
, -1, printcharfun
);
744 print_string (obj
, printcharfun
);
748 register unsigned char c
;
753 #ifdef USE_TEXT_PROPERTIES
754 if (!NULL_INTERVAL_P (XSTRING (obj
)->intervals
))
762 for (i
= 0; i
< XSTRING (obj
)->size
; i
++)
765 c
= XSTRING (obj
)->data
[i
];
766 if (c
== '\n' && print_escape_newlines
)
773 if (c
== '\"' || c
== '\\')
780 #ifdef USE_TEXT_PROPERTIES
781 if (!NULL_INTERVAL_P (XSTRING (obj
)->intervals
))
784 traverse_intervals (XSTRING (obj
)->intervals
,
785 0, 0, print_interval
, printcharfun
);
796 register int confusing
;
797 register unsigned char *p
= XSYMBOL (obj
)->name
->data
;
798 register unsigned char *end
= p
+ XSYMBOL (obj
)->name
->size
;
799 register unsigned char c
;
801 if (p
!= end
&& (*p
== '-' || *p
== '+')) p
++;
806 while (p
!= end
&& *p
>= '0' && *p
<= '9')
808 confusing
= (end
== p
);
811 p
= XSYMBOL (obj
)->name
->data
;
818 if (c
== '\"' || c
== '\\' || c
== '\'' || c
== ';' || c
== '#' ||
819 c
== '(' || c
== ')' || c
== ',' || c
=='.' || c
== '`' ||
820 c
== '[' || c
== ']' || c
== '?' || c
<= 040 || confusing
)
821 PRINTCHAR ('\\'), confusing
= 0;
829 /* If deeper than spec'd depth, print placeholder. */
830 if (XTYPE (Vprint_level
) == Lisp_Int
831 && print_depth
> XINT (Vprint_level
))
833 strout ("...", -1, printcharfun
);
840 register int max
= 0;
842 if (XTYPE (Vprint_length
) == Lisp_Int
)
843 max
= XINT (Vprint_length
);
844 /* Could recognize circularities in cdrs here,
845 but that would make printing of long lists quadratic.
846 It's not worth doing. */
853 strout ("...", 3, printcharfun
);
856 print (Fcar (obj
), printcharfun
, escapeflag
);
860 if (!NILP (obj
) && !CONSP (obj
))
862 strout (" . ", 3, printcharfun
);
863 print (obj
, printcharfun
, escapeflag
);
869 strout ("#", -1, printcharfun
);
874 register Lisp_Object tem
;
875 for (i
= 0; i
< XVECTOR (obj
)->size
; i
++)
877 if (i
) PRINTCHAR (' ');
878 tem
= XVECTOR (obj
)->contents
[i
];
879 print (tem
, printcharfun
, escapeflag
);
887 if (NILP (XBUFFER (obj
)->name
))
888 strout ("#<killed buffer>", -1, printcharfun
);
891 strout ("#<buffer ", -1, printcharfun
);
892 print_string (XBUFFER (obj
)->name
, printcharfun
);
896 print_string (XBUFFER (obj
)->name
, printcharfun
);
902 strout ("#<process ", -1, printcharfun
);
903 print_string (XPROCESS (obj
)->name
, printcharfun
);
907 print_string (XPROCESS (obj
)->name
, printcharfun
);
911 strout ("#<window ", -1, printcharfun
);
912 sprintf (buf
, "%d", XFASTINT (XWINDOW (obj
)->sequence_number
));
913 strout (buf
, -1, printcharfun
);
914 if (!NILP (XWINDOW (obj
)->buffer
))
916 strout (" on ", -1, printcharfun
);
917 print_string (XBUFFER (XWINDOW (obj
)->buffer
)->name
, printcharfun
);
922 case Lisp_Window_Configuration
:
923 strout ("#<window-configuration>", -1, printcharfun
);
928 strout ((FRAME_LIVE_P (XFRAME (obj
))
929 ? "#<frame " : "#<dead frame "),
931 print_string (XFRAME (obj
)->name
, printcharfun
);
932 sprintf (buf
, " 0x%x", (unsigned int) (XFRAME (obj
)));
933 strout (buf
, -1, printcharfun
);
934 strout (">", -1, printcharfun
);
936 #endif /* MULTI_FRAME */
939 strout ("#<marker ", -1, printcharfun
);
940 if (!(XMARKER (obj
)->buffer
))
941 strout ("in no buffer", -1, printcharfun
);
944 sprintf (buf
, "at %d", marker_position (obj
));
945 strout (buf
, -1, printcharfun
);
946 strout (" in ", -1, printcharfun
);
947 print_string (XMARKER (obj
)->buffer
->name
, printcharfun
);
951 #endif /* standalone */
954 strout ("#<subr ", -1, printcharfun
);
955 strout (XSUBR (obj
)->symbol_name
, -1, printcharfun
);
963 #ifdef USE_TEXT_PROPERTIES
965 /* Print a description of INTERVAL using PRINTCHARFUN.
966 This is part of printing a string that has text properties. */
969 print_interval (interval
, printcharfun
)
971 Lisp_Object printcharfun
;
973 print (make_number (interval
->position
), printcharfun
, 1);
975 print (make_number (interval
->position
+ LENGTH (interval
)),
978 print (interval
->plist
, printcharfun
, 1);
982 #endif /* USE_TEXT_PROPERTIES */
987 staticpro (&Qprint_escape_newlines
);
988 Qprint_escape_newlines
= intern ("print-escape-newlines");
990 DEFVAR_LISP ("standard-output", &Vstandard_output
,
991 "Output stream `print' uses by default for outputting a character.\n\
992 This may be any function of one argument.\n\
993 It may also be a buffer (output is inserted before point)\n\
994 or a marker (output is inserted and the marker is advanced)\n\
995 or the symbol t (output appears in the minibuffer line).");
996 Vstandard_output
= Qt
;
997 Qstandard_output
= intern ("standard-output");
998 staticpro (&Qstandard_output
);
1000 #ifdef LISP_FLOAT_TYPE
1001 DEFVAR_LISP ("float-output-format", &Vfloat_output_format
,
1002 "The format descriptor string used to print floats.\n\
1003 This is a %-spec like those accepted by `printf' in C,\n\
1004 but with some restrictions. It must start with the two characters `%.'.\n\
1005 After that comes an integer precision specification,\n\
1006 and then a letter which controls the format.\n\
1007 The letters allowed are `e', `f' and `g'.\n\
1008 Use `e' for exponential notation \"DIG.DIGITSeEXPT\"\n\
1009 Use `f' for decimal point notation \"DIGITS.DIGITS\".\n\
1010 Use `g' to choose the shorter of those two formats for the number at hand.\n\
1011 The precision in any of these cases is the number of digits following\n\
1012 the decimal point. With `f', a precision of 0 means to omit the\n\
1013 decimal point. 0 is not allowed with `f' or `g'.\n\n\
1014 A value of nil means to use `%.20g'.");
1015 Vfloat_output_format
= Qnil
;
1016 Qfloat_output_format
= intern ("float-output-format");
1017 staticpro (&Qfloat_output_format
);
1018 #endif /* LISP_FLOAT_TYPE */
1020 DEFVAR_LISP ("print-length", &Vprint_length
,
1021 "Maximum length of list to print before abbreviating.\n\
1022 A value of nil means no limit.");
1023 Vprint_length
= Qnil
;
1025 DEFVAR_LISP ("print-level", &Vprint_level
,
1026 "Maximum depth of list nesting to print before abbreviating.\n\
1027 A value of nil means no limit.");
1028 Vprint_level
= Qnil
;
1030 DEFVAR_BOOL ("print-escape-newlines", &print_escape_newlines
,
1031 "Non-nil means print newlines in strings as backslash-n.");
1032 print_escape_newlines
= 0;
1034 /* prin1_to_string_buffer initialized in init_buffer_once in buffer.c */
1035 staticpro (&Vprin1_to_string_buffer
);
1038 defsubr (&Sprin1_to_string
);
1042 defsubr (&Swrite_char
);
1043 defsubr (&Sexternal_debugging_output
);
1045 Qexternal_debugging_output
= intern ("external-debugging-output");
1046 staticpro (&Qexternal_debugging_output
);
1049 defsubr (&Swith_output_to_temp_buffer
);
1050 #endif /* not standalone */