From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.devel Subject: Re: prin1 / princ vs message ? Date: Sun, 2 Jul 2017 21:44:16 +0900 (JST) 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: multipart/mixed; BOUNDARY="8323329-1721346780-1498999460=:13347" X-Trace: blaine.gmane.org 1498999476 665 195.159.176.226 (2 Jul 2017 12:44:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 2 Jul 2017 12:44:36 +0000 (UTC) User-Agent: Alpine 2.20 (DEB 67 2015-01-07) 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:44:32 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 1dReEp-00088r-AX for ged-emacs-devel@m.gmane.org; Sun, 02 Jul 2017 14:44:31 +0200 Original-Received: from localhost ([::1]:57948 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dReEr-00072D-Hc for ged-emacs-devel@m.gmane.org; Sun, 02 Jul 2017 08:44:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dReEl-00071k-7Q for emacs-devel@gnu.org; Sun, 02 Jul 2017 08:44:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dReEg-0005l2-9F for emacs-devel@gnu.org; Sun, 02 Jul 2017 08:44:27 -0400 Original-Received: from mail-pf0-x22c.google.com ([2607:f8b0:400e:c00::22c]:33026) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dReEg-0005kL-3K for emacs-devel@gnu.org; Sun, 02 Jul 2017 08:44:22 -0400 Original-Received: by mail-pf0-x22c.google.com with SMTP id e7so87638460pfk.0 for ; Sun, 02 Jul 2017 05:44:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=R6VPUpO/5j/Zv19JoTGooC2DosF/sRmUUBEdL2KxcX0=; b=KDaBMQYkZ0e2rV1+exP8RNtJ2CL3QikH5mIB2BRq6izsNYekHymFWm15o6V/hmtXri bHLXQQPeNdg2JhWnsZL/h7LgKRfs6dxyPBXd70AUtYRy2tEHLmVdU1D96ERMyjTgCnAh B34gM8dzk8If45TDWyiVZLREcIyYrgyKu4uZkpzMTjX4COAn8c493kNHOrwAtVndFhjV joPI+Tpd3wxPrEkn/d8Slwfd0m4un3hsCOHMdV+zBWC1+TktappMCgCgF2wacHRcCGso zFsmbBdYsyViLbmqgXDkSQecyV7Iy5GpLXXj2FxmnAw6eL+3twSpyrgbCTafQldPM4al F5Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=R6VPUpO/5j/Zv19JoTGooC2DosF/sRmUUBEdL2KxcX0=; b=dfHNLwSHNkVPu1JpwQNKdCqzhXKXiejFQRpqYFuvBfajbGsopySxOUVe+bfF+u0Eck ogTZPoRoyQF69rbJvP6cCORfeijBY3h0rFViKEL6jO0GscY/fH6Q8eGZ5xIC3S7FZrw8 M3fuvXGoVyDWXLRxo6YEwALVwno3mRW18C3HVnYNSsq3/EcXBSVP05WyLkHW7mIIlnTB yaWx1kAngF0iMLQcxGvC35YC8UORzAok9BDD6wschBel6RqPe1QBHlVI4GNPJJSMcJrI SSZkNnQWdbr70ZSGKecKXPrTYXWvZJjeO7wvJdVNBKPaeuuKtIn4nMmAC+nIQBz//Eyv 9vJQ== X-Gm-Message-State: AIVw110nZV/8FPkD+qApKri7qRlo7ORSk8mkvhNW8NNpQgrtNTvzhk+O Ik2ZWfnmS3TAiw== X-Received: by 10.99.117.94 with SMTP id f30mr5222640pgn.197.1498999460897; Sun, 02 Jul 2017 05:44:20 -0700 (PDT) Original-Received: from calancha-pc (222.139.137.133.dy.bbexcite.jp. [133.137.139.222]) by smtp.gmail.com with ESMTPSA id j29sm29281157pfj.68.2017.07.02.05.44.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Jul 2017 05:44:20 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc In-Reply-To: <94EF128F-6A3D-41DD-B92D-0C165A4A8EB9@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::22c 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:216092 Archived-At: --8323329-1721346780-1498999460=:13347 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT On Sun, 2 Jul 2017, Jean-Christophe Helary wrote: > * Documentation about prin? family: > (info "(elisp) Output Functions") > > * "The recommended way to show a message in the echo area is with the >  `message' function, not `princ’". >  Extracted from: > (info "(elisp) Programming Tips") > > * `message' and the echo area: > (info "(elisp) The Echo Area") > > > Tino, > > I think that was pretty clear that I had actually read the documentation about prin1, princ and message. So let me reiterate: Appologies, i misunderstood that. > > 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). > > The documentation seems to imply that message should be preferred, but are there cases where prin1/princ are the best choice ? In my case i use `message' most of the time. I just use `prin?' things when i want to insert the printable representation of a lisp object withing a buffer. Not so often, though. In files, like international/quail.el or international/mule-diag.el note that they use the macro `with-output-to-temp-buffer', so they must use `prin?' instead of `message' to collect the standard-output. Even when `with-output-to-temp-buffer' is not called explicitely in the file, like in lisp/cus-theme.el you better use `prin?' there, because those are messages related with the Emacs help, i mean, they will appear in *Help* buffers which are build binding standard-output. Other than that i would stick with `message'. --8323329-1721346780-1498999460=:13347--