查看变量的当前值

你可以使用 describe-variable 函数 查看任意变量的当前值, 该函数通常通过按键 C-h v 调用。 如果你按下 C-h v, 并在提示后输入 kill-ring(再按 RET), 就会看到当前删除环中的内容 — 可能会非常多! 反之,如果你在本次 Emacs 会话中 除了阅读本文档之外没有任何操作,删除环可能为空。 同时,你还会看到 kill-ring 的文档说明:

Documentation:
List of killed text sequences.
Since the kill ring is supposed to interact nicely with cut-and-paste
facilities offered by window systems, use of this variable should
interact nicely with `interprogram-cut-function' and
`interprogram-paste-function'.  The functions `kill-new',
`kill-append', and `current-kill' are supposed to implement this
interaction; you may want to use them instead of manipulating the kill
ring directly.

删除环通过 defvar 按如下方式定义:

(defvar kill-ring nil
  "List of killed text sequences.
...")

在该变量定义中,变量的初始值被设为 nil, 这是合理的:如果你未保存任何内容, 执行取回命令时就应该什么都得不到。 文档字符串的写法与 defun 的文档字符串完全相同。 与 defun 的文档字符串一样, 文档的第一行应当是完整句子, 因为 apropos 等命令只会打印第一行文档。 后续行不应缩进, 否则在使用 C-h vdescribe-variable)查看时排版会异常。