From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: wrapper fn for message and minibuffer-message? Date: Tue, 4 Oct 2005 14:58:52 -0700 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1128463399 31449 80.91.229.2 (4 Oct 2005 22:03:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 4 Oct 2005 22:03:19 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 05 00:03:18 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EMuqW-0007B8-AB for ged-emacs-devel@m.gmane.org; Wed, 05 Oct 2005 00:01:12 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EMuqW-0001Oe-2x for ged-emacs-devel@m.gmane.org; Tue, 04 Oct 2005 18:01:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EMuqM-0001Ml-1H for emacs-devel@gnu.org; Tue, 04 Oct 2005 18:01:02 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EMuqK-0001M9-DU for emacs-devel@gnu.org; Tue, 04 Oct 2005 18:01:01 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EMuqK-0001M6-8l for emacs-devel@gnu.org; Tue, 04 Oct 2005 18:01:00 -0400 Original-Received: from [148.87.122.30] (helo=rgminet01.oracle.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1EMuqJ-0003Ve-L5 for emacs-devel@gnu.org; Tue, 04 Oct 2005 18:00:59 -0400 Original-Received: from rgmgw2.us.oracle.com (rgmgw2.us.oracle.com [138.1.186.111]) by rgminet01.oracle.com (Switch-3.1.6/Switch-3.1.6) with ESMTP id j94M0t5Q018350 for ; Tue, 4 Oct 2005 16:00:55 -0600 Original-Received: from rgmgw2.us.oracle.com (localhost [127.0.0.1]) by rgmgw2.us.oracle.com (Switch-3.1.4/Switch-3.1.0) with ESMTP id j94M0tsv017785 for ; Tue, 4 Oct 2005 16:00:55 -0600 Original-Received: from rgmum301.us.oracle.com (rgmum301.us.oracle.com [138.1.186.41]) by rgmgw2.us.oracle.com (Switch-3.1.4/Switch-3.1.0) with ESMTP id j940fa9u007439 for ; Tue, 4 Oct 2005 16:00:55 -0600 Original-Received: from dhcp-amer-csvpn-gw2-141-144-75-41.vpn.oracle.com by rgmum301.us.oracle.com with ESMTP id 1232624711128463137; Tue, 04 Oct 2005 15:58:57 -0600 Original-To: "Emacs-Devel" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE 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:43553 Archived-At: Ignore if already discussed or idea seems useless. I have some commands that users can use either at top level or when in the minibuffer. (In the latter case, they are bound to keys.) I use the following wrapper function, and I wonder if such a function might not be useful generally, for defining Emacs commands that are likely to be (also) bound in a minibuffer map. Some toggle commands are examples of use cases - toggles that can take effect while still inputting in the minibuffer. (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))) No, this does not provide the generality of `message', which accepts a format string and possibly other args to be formatted. It might nevertheless be useful.