diff options
Diffstat (limited to 'lispref/streams.texi')
-rw-r--r-- | lispref/streams.texi | 53 |
1 files changed, 49 insertions, 4 deletions
diff --git a/lispref/streams.texi b/lispref/streams.texi index 2209a40baf9..90089b10bf7 100644 --- a/lispref/streams.texi +++ b/lispref/streams.texi @@ -716,25 +716,25 @@ In the second expression, the local binding of @tindex print-escape-nonascii @defvar print-escape-nonascii -If this variable is non-@code{nil}, then unibyte non-@sc{ASCII} +If this variable is non-@code{nil}, then unibyte non-@sc{ascii} characters in strings are unconditionally printed as backslash sequences by the print functions @code{prin1} and @code{print} that print with quoting. -Those functions also use backslash sequences for unibyte non-@sc{ASCII} +Those functions also use backslash sequences for unibyte non-@sc{ascii} characters, regardless of the value of this variable, when the output stream is a multibyte buffer or a marker pointing into one. @end defvar @tindex print-escape-multibyte @defvar print-escape-multibyte -If this variable is non-@code{nil}, then multibyte non-@sc{ASCII} +If this variable is non-@code{nil}, then multibyte non-@sc{ascii} characters in strings are unconditionally printed as backslash sequences by the print functions @code{prin1} and @code{print} that print with quoting. Those functions also use backslash sequences for multibyte -non-@sc{ASCII} characters, regardless of the value of this variable, +non-@sc{ascii} characters, regardless of the value of this variable, when the output stream is a unibyte buffer or a marker pointing into one. @end defvar @@ -766,3 +766,48 @@ parentheses and brackets when printed. Any list or vector at a depth exceeding this limit is abbreviated with an ellipsis. A value of @code{nil} (which is the default) means no limit. @end defvar + + These variables are used for detecting and reporting circular +and shared structure---but they are only defined in Emacs 21. + +@tindex print-circle +@defvar print-circle +If non-@code{nil}, this variable enables detection of circular +and shared structure in printing. +@end defvar + +@tindex print-gensym +@defvar print-gensym +If non-@code{nil}, this variable enables detection of uninterned symbols +(@pxref{Creating Symbols}) in printing. When this is enabled, +uninterned symbols print with the prefix @samp{#:}, which tells the Lisp +reader to produce an uninterned symbol. +@end defvar + +@tindex print-continuous-numbering +@defvar print-continuous-numbering +To print several objects with shared structure in common, you should +bind @code{print-continuous-numbering} to @code{t} around them all. +That tells @code{print} not to reinitialize @code{print-number-table} +each time. +@end defvar + +@tindex print-number-table +@defvar print-number-table +This variable holds the table used as the basis of outputting +@samp{#@var{n}=} and @samp{#@var{n}#} constructs for circular and shared +structure. When you want to print several objects with shared structure +in common, you should bind @code{print-number-table} to @code{nil} +around them all. +@end defvar + + Here is an example of printing two objects with a common +set of shared substructure: + +@example +(let ((print-circle t) + (print-continuous-numbering t) + print-number-table) + (print1 x) + (print1 y)) +@end example |