[Top][All Lists]

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

RE: [External] : messages to *Messages* without appearing in mini-buffer

From: Drew Adams
Subject: RE: [External] : messages to *Messages* without appearing in mini-buffer?
Date: Fri, 12 Nov 2021 17:01:13 +0000

> >>> What you see is the printed return value of
> >>> the sexp you asked to evaluate-AND-PRINT.
> >>> Try `eval-region' on the sexp instead.
> >>> Or put it in a defun and invoke the function in a way that
> >>> doesn't also print its return value.
> >>
> >> (progn
> >>   (message "But then why don't you just do that?")
> >>   1)
> >
> > Because you don't need to do that, to prevent `message' from
> > displaying in the echo area.
> >
> > Printing a return value from evaluating a sexp has nothing
> > to do with the question. See the Subject line.
> Eheh ... is it off-topic?

Dunno what you're asking.  Are you perhaps asking
whether I think your question is outside of the
topic of the originally posed question?  Maybe it
it is, but it's not off-topic for this mailing list.

And it's a FAQ that comes up often when looking at
behavior involving commands that echo the result of
an evaluation.  So it's generally good to bring it
up and good to answer it.

You asked (I think) why I didn't just end the sexp
I wrote with some other value than that returned by
the `message' call, to avoid confusion between
printing that return value in the echo area and what
`message' itself does with the message (it doesn't
print it to the echo area).

I answered that I wrote a minimal sexp that answered
the original question: how to prevent `message' from
printing to the echo area.

That's what one typically does: bind `inhibit-message'.
Anything else isn't germane to the original question,
and including it in the code could give the false
impression that it's needed as part of the answer.

But of course including something else (e.g. a
different return value) and not including it can
each lead to confusion.

<<attachment: winmail.dat>>

reply via email to

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