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: wrapper fn for message and minibuffer-message? Date: Wed, 05 Oct 2005 11:53:57 -0400 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1128527800 8207 80.91.229.2 (5 Oct 2005 15:56:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 5 Oct 2005 15:56:40 +0000 (UTC) Cc: Emacs-Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 05 17:56:37 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ENBaw-0001TW-0r for ged-emacs-devel@m.gmane.org; Wed, 05 Oct 2005 17:54:14 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ENBav-00053B-9v for ged-emacs-devel@m.gmane.org; Wed, 05 Oct 2005 11:54:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ENBam-00052w-R3 for emacs-devel@gnu.org; Wed, 05 Oct 2005 11:54:04 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ENBal-00052d-AM for emacs-devel@gnu.org; Wed, 05 Oct 2005 11:54:04 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ENBal-00052a-8N for emacs-devel@gnu.org; Wed, 05 Oct 2005 11:54:03 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1ENBal-0005dP-FK for emacs-devel@gnu.org; Wed, 05 Oct 2005 11:54:03 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id B3D492CF43A; Wed, 5 Oct 2005 11:54:02 -0400 (EDT) Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 3DFAA4AC00D; Wed, 5 Oct 2005 11:53:58 -0400 (EDT) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id 125475121; Wed, 5 Oct 2005 11:53:58 -0400 (EDT) Original-To: "Drew Adams" In-Reply-To: (Drew Adams's message of "Tue, 4 Oct 2005 14:58:52 -0700") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-4.848, requis 5, autolearn=not spam, AWL 0.05, BAYES_00 -4.90) X-MailScanner-From: monnier@iro.umontreal.ca X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:43575 Archived-At: > (defun msg-maybe-in-minibuffer (string &rest args) > "Display STRING with `message' or `minibuffer-message', as appropriate." > (if (active-minibuffer-window) > (minibuffer-message (format " [%s]" string)) > (message string))) I agree 100% with the intention. Typical such messages are the completion messages, for completion functions that can be used both in the minibuffer and in normal buffers. E.g. the pcomplete functions. Of course I'd define it more like (defun msg-maybe-in-minibuffer (format &rest args) "Display STRING with `message' or `minibuffer-message', as appropriate." (if (minibufferp) (minibuffer-message (apply 'format (concat " [" format "]") args)) (apply 'message format args))) I'd even argue that this function should be called "minibuffer-message", since currently minibuffer-message is only used when (minibufferp) is non-nil. Stefan