From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Annoying paren match messages in minibuffer Date: Wed, 14 Jan 2009 23:12:18 +0200 Organization: JURTA Message-ID: <87tz818udp.fsf@jurta.org> References: <87y6xedc47.fsf@jurta.org> <87ocyat2y5.fsf@cyd.mit.edu> <000401c9765c$e7d22eb0$0200a8c0@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1231967959 29923 80.91.229.12 (14 Jan 2009 21:19:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 14 Jan 2009 21:19:19 +0000 (UTC) Cc: 'Chong Yidong' , 'Geoff Gole' , 'Stefan Monnier' , emacs-devel@gnu.org To: "Drew Adams" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 14 22:20:30 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LND9z-0005xC-KJ for ged-emacs-devel@m.gmane.org; Wed, 14 Jan 2009 22:20:26 +0100 Original-Received: from localhost ([127.0.0.1]:43540 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LND8i-0005cN-FM for ged-emacs-devel@m.gmane.org; Wed, 14 Jan 2009 16:19:04 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LND7t-0005A4-78 for emacs-devel@gnu.org; Wed, 14 Jan 2009 16:18:13 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LND7r-00058R-Cs for emacs-devel@gnu.org; Wed, 14 Jan 2009 16:18:12 -0500 Original-Received: from [199.232.76.173] (port=33937 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LND7r-000580-18 for emacs-devel@gnu.org; Wed, 14 Jan 2009 16:18:11 -0500 Original-Received: from relay02.kiev.sovam.com ([62.64.120.197]:58854) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LND7p-00055L-H2 for emacs-devel@gnu.org; Wed, 14 Jan 2009 16:18:10 -0500 Original-Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay02.kiev.sovam.com with esmtp (Exim 4.69) (envelope-from ) id 1LND7k-000JOj-UL; Wed, 14 Jan 2009 23:18:05 +0200 In-Reply-To: <000401c9765c$e7d22eb0$0200a8c0@us.oracle.com> (Drew Adams's message of "Wed, 14 Jan 2009 07:29:30 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu) X-Scanner-Signature: 6f32a619495bd298c8ed4cb100af0918 X-DrWeb-checked: yes X-detected-operating-system: by monty-python.gnu.org: FreeBSD 6.x (1) 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:107864 Archived-At: > I do the same thing myself, but only as a separate function. So when I want > unconditional behavior (regardless of the current buffer) I can still call > either `message' or `minibuffer-message' instead. As a general solution it would be better to change `message' to take care about the minibuffer's case. > BTW, don't you need to ensure that the minibuffer window is active? I think `active-minibuffer-window' is not suitable for this. It returns non-nil even when the current buffer is not the minibuffer, but there is no need to do this because it doesn't clobber the current user input (i.e. when the user switched from the active minibuffer to another buffer). > FWIW, this is the code I use: > > (defun msg-maybe-in-minibuffer (format-string &rest args) > "Display FORMAT-STRING as a message. > If called with the minibuffer inactive, use `message'. > Otherwise, use `minibuffer-message'." > (if (active-minibuffer-window) > (save-selected-window > (select-window (minibuffer-window)) > (minibuffer-message > (apply #'format > (concat " [" format-string "]") args))) > (apply #'message format-string args))) -- Juri Linkov http://www.jurta.org/emacs/