From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Using temporary buffers to display messages Date: Thu, 29 Mar 2012 10:31:24 -0400 Message-ID: References: <87vclogml7.fsf@wanadoo.es> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1333031499 26968 80.91.229.3 (29 Mar 2012 14:31:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 29 Mar 2012 14:31:39 +0000 (UTC) Cc: emacs-devel@gnu.org To: =?iso-8859-1?Q?=D3scar?= Fuentes Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 29 16:31:38 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SDGO0-0006HO-PR for ged-emacs-devel@m.gmane.org; Thu, 29 Mar 2012 16:31:37 +0200 Original-Received: from localhost ([::1]:50934 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDGO0-0007Xh-33 for ged-emacs-devel@m.gmane.org; Thu, 29 Mar 2012 10:31:36 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:50859) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDGNx-0007XI-T1 for emacs-devel@gnu.org; Thu, 29 Mar 2012 10:31:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SDGNr-0000Q8-EG for emacs-devel@gnu.org; Thu, 29 Mar 2012 10:31:33 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:7175) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDGNr-0000Ok-1D for emacs-devel@gnu.org; Thu, 29 Mar 2012 10:31:27 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AicFAKU/KE9MCqRV/2dsb2JhbACBX5x7eYhwnhmGGQSbGYQJ X-IronPort-AV: E=Sophos;i="4.73,1,1325480400"; d="scan'208";a="170569014" Original-Received: from 76-10-164-85.dsl.teksavvy.com (HELO pastel.home) ([76.10.164.85]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 29 Mar 2012 10:31:25 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 6B21E59437; Thu, 29 Mar 2012 10:31:24 -0400 (EDT) In-Reply-To: <87vclogml7.fsf@wanadoo.es> (=?iso-8859-1?Q?=22=D3scar?= Fuentes"'s message of "Thu, 29 Mar 2012 04:36:20 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:149243 Archived-At: > `sunrise-sunset' contains this code, that displays the text on the > minibuffer if the frame is wide enough and on a temporary buffer > otherwise: > (if (<= (length msg) (frame-width)) > (message "%s" msg) > (with-output-to-temp-buffer "*temp*" > (princ (concat date-string "\n" time-string))) > (message "%s" > (substitute-command-keys > (if one-window > (if pop-up-windows > "Type \\[delete-other-windows] to remove temp window." > "Type \\[switch-to-buffer] RET to remove temp window.") > "Type \\[switch-to-buffer-other-window] RET to restore old \ > contents of temp window.")))) > Is it correct nowadays to use a temporary buffer for displaying > informative text when it doesn't fit on a single line or is it a vestige > of the times when the minibuffer lacked autoexpand capabilities? It's not incorrect. As for whether it's the best choice, it depends. In general, for messages which are expected to be short (tho more than a single line), I think `message' is the better choice, unless you can expect that the user will often want to spend a bit of time looking at the different parts of the message. Stefan "whose minibuffer never has more than 1 line"