From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.devel Subject: Re: prin1 / princ vs message ? Date: Sun, 2 Jul 2017 08:45:58 -0400 Message-ID: References: <061782A1-0A51-49A1-9AA4-706AF8927D01@gmail.com> <94EF128F-6A3D-41DD-B92D-0C165A4A8EB9@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1498999575 18672 195.159.176.226 (2 Jul 2017 12:46:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 2 Jul 2017 12:46:15 +0000 (UTC) Cc: Emacs developers To: Jean-Christophe Helary Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 02 14:46:08 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dReGI-0004FU-7e for ged-emacs-devel@m.gmane.org; Sun, 02 Jul 2017 14:46:02 +0200 Original-Received: from localhost ([::1]:57955 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dReGN-0007lb-Cs for ged-emacs-devel@m.gmane.org; Sun, 02 Jul 2017 08:46:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dReGG-0007lW-UL for emacs-devel@gnu.org; Sun, 02 Jul 2017 08:46:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dReGG-0007ev-AZ for emacs-devel@gnu.org; Sun, 02 Jul 2017 08:46:00 -0400 Original-Received: from mail-oi0-x233.google.com ([2607:f8b0:4003:c06::233]:36299) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dReGG-0007eO-5g for emacs-devel@gnu.org; Sun, 02 Jul 2017 08:46:00 -0400 Original-Received: by mail-oi0-x233.google.com with SMTP id x187so8144270oig.3 for ; Sun, 02 Jul 2017 05:45:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=HxTXVpSWnW2NuQyolKkmrhcKoW7R+OQ2PMAwMGdMwnU=; b=OwfYem1YZIcMsdbqjT604zEMCfjVmA9BvRRuK53RxEC/vNVzVe+RUF6hSRyEvrnKJe dJklY7MGoNUtPR6ndR1VgfWoM5LSxL6AqQxDEV0l0lPh/gZASoDFr+xE6UCqDC/9luQ2 nMLRPJKE2mkzc0BpOPijtMrnAHSbLOAaa4jpjtOpv/YgDd/BH4nRTyCFR677D1fhoTFO 0Z5MhT1ZeqSgtIUKytTSF/o3iCegyf8wroFmSeGpLLbEUCCorNz/UDOwCY3nInTZvnsG whqdNE+BmedPauvQkZEK3oMQkboxsYuao35pwdni7nf2C6bgyRxj4REsRnuCOp5q1kK/ ydpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=HxTXVpSWnW2NuQyolKkmrhcKoW7R+OQ2PMAwMGdMwnU=; b=toGA/jQbmAcIeVgdNH9EMDMwkKyV/eP+joypk5150PoP+03beD3YQou17cqDUYUncj jINd6QmSv7ohPC+8b5R1B3oiDa/mlJImwzTKr0L+hehlOTKN8wMjMCeDhH+VBOhRpeQK vd3qV/ij9igsrL9Bf47rbLJmG7Q8Pwnn2wCXzIgz7jBxk78bC8lIBcZFWJ0LKn4H5kOo mxs/JXUTuxq4M+XYE5o4bc3uinuVRPfge0fZbKKV6pGc+h0W0JURrPchvGO2fPdp9/oH 170bB9vnNIdhNqA7DuM8w/FFI94xFEhpsfFVdGahG3OtKTiec4fSp2arlz6NzpSsntTY 1QoA== X-Gm-Message-State: AIVw112NigBYMrjP7jpatn9ZsuZdQvho25OhUY0BReCbdxE2LkWwLdoP 0Riocb6WPVQmVOsNas0KdMzvEvrXYA== X-Received: by 10.202.92.139 with SMTP id q133mr3527319oib.206.1498999559298; Sun, 02 Jul 2017 05:45:59 -0700 (PDT) Original-Received: by 10.74.113.91 with HTTP; Sun, 2 Jul 2017 05:45:58 -0700 (PDT) In-Reply-To: <94EF128F-6A3D-41DD-B92D-0C165A4A8EB9@gmail.com> X-Google-Sender-Auth: wIt1ed6g1j7q0PhDKqGvhCjymTA X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::233 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:216093 Archived-At: On Sun, Jul 2, 2017 at 8:21 AM, Jean-Christophe Helary 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".