我跑到下面的代碼在臨時緩衝區打印的i
兩個15個連續值和ielm REPL:的Emacs Lisp打印輸出
(defvar i 0)
(while (< i 15)
(print i)
(setq i (+ i 1)))`
我在這兩個臨時緩衝區和REPL注意到什麼,是他們都只顯示sexp的結果值。然後將i
的打印值發送到Messages
緩衝區。
- 至少對於repl來說,我怎樣才能得到打印在repl中的
i
的值? - 如果您有其他適合您的解決方案,請告訴我!
請注意,我通過終端和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.
- 由於我是新來的口齒不清的實際問題,我怎麼打印到不同的緩衝區?
無法從我的'.emacs'文件加載common-lisp功能? – CodeKingPlusPlus
@CodeKingPlusPlus我不太清楚你在問什麼...... Common Lisp是一種獨立的編程語言,然而,在Emacs Lisp中有一個'cl'包,它提供的功能類似於其原型中的功能。然而,這個軟件包沒有類似於Common Lisp的'format',我的'cl-format'功能是爲了補償這種遺漏。 – 2013-08-25 16:31:48
這就是我所問的。謝謝! – CodeKingPlusPlus