# 19.6 输出变量

Variable: standard-output

该变量的值指明了输出函数默认使用的输出流。默认值为 t，这意味着使用回显区域作为输出流。

Variable: print-qouted

若该变量的值为non-nil，则意味着使用简略读取语法。也就是说(qoute foo) 打印为 'foo，而(function foo) 打印为 #'foo。默认值为 t。

Variable: print-escape-newlines

若该变量的值为non-nil，那么换行符将会被打印为 '\n'，而制表符会被打印为 '\f'。通常这些符号会被打印为真正的符号。

这个变量会影响函数 prin1 和 print。而不会影响函数 princ。这里有一个例子：

```
(prin1 "a\nb")
     -| "a
     -| b"
     ⇒ "a
b"

(let ((print-escape-newlines t))
  (prin1 "a\nb"))
     -| "a\nb"
     ⇒ "a
b"

```

在第二个表达式中，print-escape-newlines 的局部绑定影响了 prin1 的调用，而不影响打印结果。

Variable: print-escape-control-characters

若该变量为 non-nil，控制符将会被以反斜杠序列打印出来。这个变量会影响 prin1 和pirnt。若该变量和 print-escape-newlines 同时为 non-nil，那么后者会影响 换行符 和 制表符 的打印。

Variable: print-escape-nonascii

若该变量为 non-nil，那么单字节 非ASCII字符将会以反斜杠序列输出，这个函数会影响 prin1 和 pirnt。

若输出流为多字节缓冲区，那么这个变量不会起作用。

Variable: print-escape-multibyte

若该变量为 non-nil，那么多字节 非ASCII字符将会以反斜杠序列输出，这个函数会影响 prin1 和 pirnt。

若输出流为单字节缓冲区，那么这个变量不会起作用。

Variable: print-charset-text-property

该变量控制是否输出文本的文本属性。其值应当为 nil，t或default。

若该值为 nil，那么 字符集文本属性永远不会被打印。如果为 t，则会打印。

若该值为 default，那么只会打印意料之外（"unexpected")的字符集的文本属性。所有的 ASCII 字符都是意料内的。此外，意料内的字符属性还会在 char-charset 中给出。

Variable: print-length

该变量的值指明了打印列表，向量，或布尔向量是，最大的显示长度。而超出该值的元素会全部使用省略号代替显示。

该变量的默认值为 nil，也就是没有限制。

```
(setq print-length 2)
     ⇒ 2
(print '(1 2 3 4 5))
     -| (1 2 ...)
     ⇒ (1 2 ...)
```

Variable: print-level

该变量的值指明了打印显示的最大的括号嵌套深度。而任何超出该嵌套深度的列表或向量都会使用省略号代替。该变量的默认值为 nil，也就是没有限制。

User Option: eval-expression-print-length

User Option: eval-expression-print-level

这两个变量是提供给 ecal-expression 使用的 print-length 和 print-level 的值，通常会被交互求值命令间接的使用。（详情查阅 The GNU Emcas Manual 中 Emacs Lisp 表达式求值 章节）。

下面的变量用于检测，汇报循环结构和共享结构：

Variable: print-circle

若该变量的值为 non-nil，那么 Emacs 将支持循环结构和共享结构的打印。详情查阅循环对象。

Variable: print-gensym

若该变量的值为 non-nil，那么 Emacs将会支持 未注册符号的打印表示（详情查阅创建符号）。若该特性被打开，所有的未注册符号的打印表示会以 '#:' 作为前缀，以此对 Lisp 读取器标明，这个符号是未注册符号。

Variable: print-continuous-numbering

若该变量的值为 non-nil，那么所有的数字表示将会是连续的。这个变量会影响打印表示中， '#n=' 标记 和 '#m#' 引用 的行为。不要使用 setq 对这个变量重新赋值；你应当使用 let 来临时的将该变量绑定到 t。不过当你这么做时，你会同时将 print-number-table 设置为了 nil。

Variable: print-number-table

该变量保存了一个内部使用的向量，以支持 print-circle 特性。除去绑定 print-continuous-numbering 对该变量的影响外，为你不应该使用这个变量。

Variable: float-output-format

该变量指明了如何打印浮点数。改变量的默认值为 nil，这意味着使用最短的表示方法来输出打印浮点数（在不损失任何信息的前提下）。

你可以通过将该变量设置为字符串，以用来更精细的控制输出。这个字符串中必须要有 '%'，这是给 C 函数 sprintf 的格式化参数。更多的限制，请查阅该变量的文本帮助。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://emacs-lisp.ivory.cafe/du-qu-he-da-yin-lisp-dui-xiang/19.6-shu-chu-bian-liang.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
