emacs-devel
[Top][All Lists]
Advanced

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

Re: prin1 / princ vs message ?


From: Noam Postavsky
Subject: Re: prin1 / princ vs message ?
Date: Sun, 2 Jul 2017 08:45:58 -0400

On Sun, Jul 2, 2017 at 8:21 AM, Jean-Christophe Helary
<address@hidden> wrote:
>
> I am asking that because I am seeing code where standard-output is not set
> to anything but it's default (the echo area) and still prin1/princ are
> preferred over message. So, why would a developer chose prin1/princ over
> message when there is no stream argument (hence, when the output goes to
> standard output).

Using prin1/princ lets the caller let-bind standard-output to redirect
the output elsewhere, using message would not allow this.

Otherwise, I think the only practical difference is that prin1/princ
to the echo area doesn't support message coalescing, e.g.,
(progn (message "foo") (message "foo")) will show "foo [2 times]" in
*Messages*, whereas (progn (princ "foo") (princ "foo")) will show
"foofoo".



reply via email to

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