I ran the following code to print 15 sequential values of i both in the scratch buffer and the ielm repl:
(defvar i 0)
(while (< i 15)
(print i)
(setq i (+ i 1)))`
What I noticed in both the scratch buffer and the repl, is that they both only show the resulting value of the sexp. The printed values of i are then sent to the Messages buffer.
- At least for the repl, how can I get the values of
iprinted in the repl? - If you have other solutions that have worked well for you, please let me know!
Note that I use emacs 24.3 through the terminal and Ubuntu 12.04 LTS. Thanks for all the help!
Additionally, From the documentation of print we have:
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.
- As I am new to practical aspects of lisp, how do I print to a different buffer?