From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Geoff Gole" Newsgroups: gmane.emacs.devel Subject: Re: Annoying paren match messages in minibuffer Date: Tue, 13 Jan 2009 22:58:54 +0900 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1231855168 4878 80.91.229.12 (13 Jan 2009 13:59:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 13 Jan 2009 13:59:28 +0000 (UTC) To: "Stefan Monnier" , miles@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 13 15:00:39 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 1LMjor-0004dV-S6 for ged-emacs-devel@m.gmane.org; Tue, 13 Jan 2009 15:00:38 +0100 Original-Received: from localhost ([127.0.0.1]:39630 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LMjnb-0004N4-By for ged-emacs-devel@m.gmane.org; Tue, 13 Jan 2009 08:59:19 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LMjnK-00047T-NV for emacs-devel@gnu.org; Tue, 13 Jan 2009 08:59:02 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LMjnJ-00044g-6q for emacs-devel@gnu.org; Tue, 13 Jan 2009 08:59:02 -0500 Original-Received: from [199.232.76.173] (port=50188 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LMjnI-00044P-Tk for emacs-devel@gnu.org; Tue, 13 Jan 2009 08:59:00 -0500 Original-Received: from rv-out-0708.google.com ([209.85.198.246]:57875) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LMjnH-0000ke-Li; Tue, 13 Jan 2009 08:58:59 -0500 Original-Received: by rv-out-0708.google.com with SMTP id k29so18773rvb.6 for ; Tue, 13 Jan 2009 05:58:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=8Go9V3tx/j9pXGuz/57iP9mnBxJ0guoL1FUlFeXxlFk=; b=LSAPj91hX8g9kHP8WN9bMEER2j6tcWl3bDgHisO2A4QZoHu88M63t0Q8A5cQFrxJeO zvL6HgV7VV9mYbWpakVd7R1Z2thPEFx7/RdKgN6dhGQtxRNr4b8nQA9jVGDBvXCleO/Y pMNgyIg4TZqHyLggOsj/nzcpEQYxhRBJO3uXY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=VoE9FnhghrAqz2a61jXgHEUH9HLy7loA/DBg1sGrHWDZKaMCJ8kupYN3P2eB90mhfu TH1xey/JtreFizUqekotD5gFn43qqwAyd4zZ+oSHEG8tBTxtvwlf70UUVzuhqcWFhy/I HpQ7SkB3bvT2mIy6vkNVct3AnzOy0XWlCVZGU= Original-Received: by 10.114.59.11 with SMTP id h11mr793420waa.187.1231855134859; Tue, 13 Jan 2009 05:58:54 -0800 (PST) Original-Received: by 10.114.113.19 with HTTP; Tue, 13 Jan 2009 05:58:54 -0800 (PST) In-Reply-To: Content-Disposition: inline X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:107818 Archived-At: > For those, you'd need to set the variable buffer-locally rather than > let-bind it. I found getting this right a touch tricky due to the possibility of recursive minibuffers. But here we go: (defun locally-suppress-paren-matching () (make-local-variable 'blink-matching-paren) (setq blink-matching-paren nil) (make-local-variable 'show-paren-mode) (setq show-paren-mode nil) ;; remove suppression so recursive minibuffers can retain matching (remove-hook 'minibuffer-setup-hook 'locally-suppress-paren-matching)) ;; This can be used to suppress spurious paren matching complaints for ;; minibuffer input that might be sensible without being balanced. (defmacro with-minibuffer-suppressed-paren-matching (&rest body) "Suppresses paren highlighting for minibuffer invocations in BODY. On entry to the minibuffer the suppression is removed, allowing paren highlighting to work for recursive minibuffers." `(let ((minibuffer-setup-hook ;; On entry, kill paren matching and remove self from ;; minibuffer-setup-hook (fix for recursive minibuffers). (cons 'locally-suppress-paren-matching minibuffer-setup-hook)) (minibuffer-exit-hook ;; On exit, add back the removed hook. (cons (lambda () (add-hook 'minibuffer-setup-hook 'locally-suppress-paren-matching)) minibuffer-exit-hook))) ,@body)) I don't really like this solution. It appears to work, but requires patching in a whole bunch of places. And check out the "nifty" self removing hook! > Maybe the problem can be fixed by changing the way the message is > displayed. E.g. it could be displayed as " [unmatched paren]" at the > end of the minibuffer input, as is done for minibuffer > completion messages. I initially thought this might be a bad idea as it would require special casing paren matching in the minibuffer. The idea is growing on me, though.