我运行以下代码来打印i
暂存缓冲区和 ielm repl 中的 15 个连续值:
(defvar i 0)
(while (< i 15)
(print i)
(setq i (+ i 1)))`
我在暂存缓冲区和 repl 中注意到的是,它们都只显示了 sexp 的结果值。然后将打印的值i
发送到Messages
缓冲区。
- 至少对于 repl,我怎样才能得到
i
repl 中打印的值? - 如果您有其他对您有效的解决方案,请告诉我!
请注意,我通过终端和 Ubuntu 12.04 LTS 使用 emacs 24.3。感谢所有的帮助!
此外,根据print
我们的文档:
print is a built-in function in `C source code'.
(print OBJECT &optional PRINTCHARFUN)
Output the printed representation of OBJECT, with newlines around it.
Quoting characters are printed when needed to make output that `read'
can handle, whenever this is possible. For complex objects, the behavior
is controlled by `print-level' and `print-length', which see.
OBJECT is any of the Lisp data types: a number, a string, a symbol,
a list, a buffer, a window, a frame, etc.
A printed representation of an object is text which describes that object.
Optional argument PRINTCHARFUN is the output stream, which can be one
of these:
- a buffer, in which case output is inserted into that buffer at point;
- a marker, in which case output is inserted at marker's position;
- a function, in which case that function is called once for each
character of OBJECT's printed representation;
- a symbol, in which case that symbol's function definition is called; or
- t, in which case the output is displayed in the echo area.
If PRINTCHARFUN is omitted, the value of `standard-output' (which see)
is used instead.
- 由于我对 lisp 的实际方面不熟悉,如何打印到不同的缓冲区?