bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#3757: 23.0.95; can you explain why C-u make it appear not in minibuf


From: Stephen Berman
Subject: bug#3757: 23.0.95; can you explain why C-u make it appear not in minibuffer
Date: Sun, 05 Jul 2009 11:23:50 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

On Sun, 5 Jul 2009 12:25:00 +0800 waterloo <waterloo2005@gmail.com> wrote:

> in 11.1.2 An Example: `print-elements-of-list' of `Instruction to
> emacs lisp' , why C-u make the output not in minubuffer.
> C-u is 4 by definition .
> I can not understant why in the context.
> can you explain more details or give some link ?

I assume you are referring to this (in node
(eintr)print-elements-of-list of the Introduction to Programming in
Emacs Lisp):

"Be sure to evaluate the last expression, `(print-elements-of-list
animals)', by typing `C-u C-x C-e', that is, by giving an argument to
`eval-last-sexp'.  This will cause the result of the evaluation to be
printed in the `*scratch*' buffer instead of being printed in the echo
area."

That is, C-u is not a prefix argument of `print-elements-of-list' but of
`eval-last-sexp', and its meaning is explained in the doc string of
`eval-last-sexp', which you can read by typing `C-h f eval-last-sexp':

,----
| eval-last-sexp is an interactive compiled Lisp function in `lisp-mode.el'.
| 
| It is bound to C-x C-e.
| 
| (eval-last-sexp eval-last-sexp-arg-internal)
| 
| Evaluate sexp before point; print value in minibuffer.
| Interactively, with prefix argument, print output into current buffer.
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| Truncates long output according to the value of the variables
| `eval-expression-print-length' and `eval-expression-print-level'.
`----

You need to use `eval-last-sexp' (or another evaluation method) because
`print-elements-of-list' is not a command, i.e. an interactive function,
since it lacks `(interactive)' in its definition.  So you cannot call it
by typing `M-x print-elements-of-list' but have to explicitly evaluate
it.

Steve Berman





reply via email to

[Prev in Thread] Current Thread [Next in Thread]