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: RE: Annoying paren match messages in minibuffer Date: Wed, 14 Jan 2009 07:29:30 -0800 Message-ID: <000401c9765c$e7d22eb0$0200a8c0@us.oracle.com> References: <87y6xedc47.fsf@jurta.org> <87ocyat2y5.fsf@cyd.mit.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1231947190 11257 80.91.229.12 (14 Jan 2009 15:33:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 14 Jan 2009 15:33:10 +0000 (UTC) Cc: 'Juri Linkov' , 'Geoff Gole' , emacs-devel@gnu.org To: "'Stefan Monnier'" , "'Chong Yidong'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 14 16:34:22 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 1LN7kw-0004Gt-1e for ged-emacs-devel@m.gmane.org; Wed, 14 Jan 2009 16:34:10 +0100 Original-Received: from localhost ([127.0.0.1]:57279 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LN7jf-0004fp-Fp for ged-emacs-devel@m.gmane.org; Wed, 14 Jan 2009 10:32:51 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LN7ge-0002kD-1z for emacs-devel@gnu.org; Wed, 14 Jan 2009 10:29:44 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LN7gc-0002jl-PX for emacs-devel@gnu.org; Wed, 14 Jan 2009 10:29:43 -0500 Original-Received: from [199.232.76.173] (port=45606 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LN7gc-0002jY-JN for emacs-devel@gnu.org; Wed, 14 Jan 2009 10:29:42 -0500 Original-Received: from acsinet11.oracle.com ([141.146.126.233]:43268) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LN7gc-00033u-4q for emacs-devel@gnu.org; Wed, 14 Jan 2009 10:29:42 -0500 Original-Received: from acsinet13.oracle.com (acsinet13.oracle.com [141.146.126.235]) by acsinet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n0EFVHfi026378 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 14 Jan 2009 15:31:18 GMT Original-Received: from acsmt703.oracle.com (acsmt703.oracle.com [141.146.40.81]) by acsinet13.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n0EFUFZw032254; Wed, 14 Jan 2009 15:30:16 GMT Original-Received: from dradamslap1 (/24.5.128.33) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 14 Jan 2009 15:29:34 +0000 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: Acl2UXEtyQpJ34VzQC6aCfWs0wsKUwACoqSw X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Source-IP: acsmt703.oracle.com [141.146.40.81] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A010204.496E04E0.0108:SCFSTAT928724,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 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:107852 Archived-At: > >> An annoyance like you reported can be eliminated with the following > >> simple patch: > >> - (message "Mismatched parentheses")) > >> + (if (window-minibuffer-p (selected-window)) > >> + (minibuffer-message " [Mismatched parentheses]") > >> + (message "Mismatched parentheses"))) > > > This patch looks like the right thing to do. Does anyone see any > > problems with this change? > > Other than the fact that this should be done automatically by > `message'? No, I won't know until I try it, and I don't have the time to do that right now. But I suspect that this will sometimes lead to problems due to the delay involved with `minibuffer-message'. 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. BTW, don't you need to ensure that the minibuffer window is active? 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)))