diff options
Diffstat (limited to 'devdocs/elisp/output-variables.html')
| -rw-r--r-- | devdocs/elisp/output-variables.html | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/devdocs/elisp/output-variables.html b/devdocs/elisp/output-variables.html new file mode 100644 index 00000000..99c75b56 --- /dev/null +++ b/devdocs/elisp/output-variables.html @@ -0,0 +1,72 @@ + <h3 class="section">Variables Affecting Output</h3> <dl> <dt id="standard-output">Variable: <strong>standard-output</strong> +</dt> <dd><p>The value of this variable is the default output stream—the stream that print functions use when the <var>stream</var> argument is <code>nil</code>. The default is <code>t</code>, meaning display in the echo area. </p></dd> +</dl> <dl> <dt id="print-quoted">Variable: <strong>print-quoted</strong> +</dt> <dd><p>If this is non-<code>nil</code>, that means to print quoted forms using abbreviated reader syntax, e.g., <code>(quote foo)</code> prints as <code>'foo</code>, and <code>(function foo)</code> as <code>#'foo</code>. The default is <code>t</code>. </p></dd> +</dl> <dl> <dt id="print-escape-newlines">Variable: <strong>print-escape-newlines</strong> +</dt> <dd> + <p>If this variable is non-<code>nil</code>, then newline characters in strings are printed as ‘<samp>\n</samp>’ and formfeeds are printed as ‘<samp>\f</samp>’. Normally these characters are printed as actual newlines and formfeeds. </p> <p>This variable affects the print functions <code>prin1</code> and <code>print</code> that print with quoting. It does not affect <code>princ</code>. Here is an example using <code>prin1</code>: </p> <div class="example"> <pre class="example">(prin1 "a\nb") + -| "a + -| b" + ⇒ "a +b" +</pre> + +<pre class="example">(let ((print-escape-newlines t)) + (prin1 "a\nb")) + -| "a\nb" + ⇒ "a +b" +</pre> +</div> <p>In the second expression, the local binding of <code>print-escape-newlines</code> is in effect during the call to <code>prin1</code>, but not during the printing of the result. </p> +</dd> +</dl> <dl> <dt id="print-escape-control-characters">Variable: <strong>print-escape-control-characters</strong> +</dt> <dd><p>If this variable is non-<code>nil</code>, control characters in strings are printed as backslash sequences by the print functions <code>prin1</code> and <code>print</code> that print with quoting. If this variable and <code>print-escape-newlines</code> are both non-<code>nil</code>, the latter takes precedences for newlines and formfeeds. </p></dd> +</dl> <dl> <dt id="print-escape-nonascii">Variable: <strong>print-escape-nonascii</strong> +</dt> <dd> +<p>If this variable is non-<code>nil</code>, then unibyte non-<acronym>ASCII</acronym> characters in strings are unconditionally printed as backslash sequences by the print functions <code>prin1</code> and <code>print</code> that print with quoting. </p> <p>Those functions also use backslash sequences for unibyte non-<acronym>ASCII</acronym> characters, regardless of the value of this variable, when the output stream is a multibyte buffer or a marker pointing into one. </p> +</dd> +</dl> <dl> <dt id="print-escape-multibyte">Variable: <strong>print-escape-multibyte</strong> +</dt> <dd> +<p>If this variable is non-<code>nil</code>, then multibyte non-<acronym>ASCII</acronym> characters in strings are unconditionally printed as backslash sequences by the print functions <code>prin1</code> and <code>print</code> that print with quoting. </p> <p>Those functions also use backslash sequences for multibyte non-<acronym>ASCII</acronym> characters, regardless of the value of this variable, when the output stream is a unibyte buffer or a marker pointing into one. </p> +</dd> +</dl> <dl> <dt id="print-charset-text-property">Variable: <strong>print-charset-text-property</strong> +</dt> <dd> +<p>This variable controls printing of ‘charset’ text property on printing a string. The value should be <code>nil</code>, <code>t</code>, or <code>default</code>. </p> <p>If the value is <code>nil</code>, <code>charset</code> text properties are never printed. If <code>t</code>, they are always printed. </p> <p>If the value is <code>default</code>, only print <code>charset</code> text properties if there is an “unexpected” <code>charset</code> property. For ascii characters, all charsets are considered “expected”. Otherwise, the expected <code>charset</code> property of a character is given by <code>char-charset</code>. </p> +</dd> +</dl> <dl> <dt id="print-length">Variable: <strong>print-length</strong> +</dt> <dd> + <p>The value of this variable is the maximum number of elements to print in any list, vector or bool-vector. If an object being printed has more than this many elements, it is abbreviated with an ellipsis. </p> <p>If the value is <code>nil</code> (the default), then there is no limit. </p> <div class="example"> <pre class="example">(setq print-length 2) + ⇒ 2 +</pre> +<pre class="example">(print '(1 2 3 4 5)) + -| (1 2 ...) + ⇒ (1 2 ...) +</pre> +</div> </dd> +</dl> <dl> <dt id="print-level">Variable: <strong>print-level</strong> +</dt> <dd><p>The value of this variable is the maximum depth of nesting of 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</code> (which is the default) means no limit. </p></dd> +</dl> <dl> <dt id="eval-expression-print-length">User Option: <strong>eval-expression-print-length</strong> +</dt> <dt id="eval-expression-print-level">User Option: <strong>eval-expression-print-level</strong> +</dt> <dd><p>These are the values for <code>print-length</code> and <code>print-level</code> used by <code>eval-expression</code>, and thus, indirectly, by many interactive evaluation commands (see <a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Eval.html#Lisp-Eval">Evaluating Emacs Lisp Expressions</a> in <cite>The GNU Emacs Manual</cite>). </p></dd> +</dl> <p>These variables are used for detecting and reporting circular and shared structure: </p> <dl> <dt id="print-circle">Variable: <strong>print-circle</strong> +</dt> <dd><p>If non-<code>nil</code>, this variable enables detection of circular and shared structure in printing. See <a href="circular-objects">Circular Objects</a>. </p></dd> +</dl> <dl> <dt id="print-gensym">Variable: <strong>print-gensym</strong> +</dt> <dd><p>If non-<code>nil</code>, this variable enables detection of uninterned symbols (see <a href="creating-symbols">Creating Symbols</a>) in printing. When this is enabled, uninterned symbols print with the prefix ‘<samp>#:</samp>’, which tells the Lisp reader to produce an uninterned symbol. </p></dd> +</dl> <dl> <dt id="print-continuous-numbering">Variable: <strong>print-continuous-numbering</strong> +</dt> <dd><p>If non-<code>nil</code>, that means number continuously across print calls. This affects the numbers printed for ‘<samp>#<var>n</var>=</samp>’ labels and ‘<samp>#<var>m</var>#</samp>’ references. Don’t set this variable with <code>setq</code>; you should only bind it temporarily to <code>t</code> with <code>let</code>. When you do that, you should also bind <code>print-number-table</code> to <code>nil</code>. </p></dd> +</dl> <dl> <dt id="print-number-table">Variable: <strong>print-number-table</strong> +</dt> <dd><p>This variable holds a vector used internally by printing to implement the <code>print-circle</code> feature. You should not use it except to bind it to <code>nil</code> when you bind <code>print-continuous-numbering</code>. </p></dd> +</dl> <dl> <dt id="float-output-format">Variable: <strong>float-output-format</strong> +</dt> <dd> +<p>This variable specifies how to print floating-point numbers. The default is <code>nil</code>, meaning use the shortest output that represents the number without losing information. </p> <p>To control output format more precisely, you can put a string in this variable. The string should hold a ‘<samp>%</samp>’-specification to be used in the C function <code>sprintf</code>. For further restrictions on what you can use, see the variable’s documentation string. </p> +</dd> +</dl> <dl> <dt id="print-integers-as-characters">Variable: <strong>print-integers-as-characters</strong> +</dt> <dd> +<p>When this variable is non-<code>nil</code>, integers that represent graphic base characters will be printed using Lisp character syntax (see <a href="basic-char-syntax">Basic Char Syntax</a>). Other numbers are printed the usual way. For example, the list <code>(4 65 -1 10)</code> would be printed as ‘<samp>(4 ?A -1 ?\n)</samp>’. </p> <p>More precisely, values printed in character syntax are those representing characters belonging to the Unicode general categories Letter, Number, Punctuation, Symbol and Private-use (see <a href="character-properties">Character Properties</a>), as well as the control characters having their own escape syntax such as newline. </p> +</dd> +</dl><div class="_attribution"> + <p class="_attribution-p"> + Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br> + <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Output-Variables.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Output-Variables.html</a> + </p> +</div> |
