emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Annoying paren match messages in minibuffer


From: Juri Linkov
Subject: Re: Annoying paren match messages in minibuffer
Date: Wed, 14 Jan 2009 01:28:50 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu)

>   emacs -Q
>   M-%
>   )
>
> This is perfectly sensible input for replace-string, so seeing the nag
> message (and have it momentarily displace the minibuffer display) is
> irritating. I know that this is not a big deal as any further input
> will immediately dismiss the message, but I'd think it would be better
> not to show it in the first place. Perhaps paren matching should be
> inhibited for minibuffer input that need not be balanced?
>
> I attempted to implement this by binding blink-matching-paren and
> show-paren-mode. Unfortunately that continues to inhibit paren
> matching if the user moves out of the minibuffer, so is not
> satisfactory. The example patch below does this for query-replace.
>
> Thoughts?

Please don't disable these notifications in the minibuffer.
They are useful for detecting unbalanced parenthesis while writing
short Lisp snippets or regexps with a lot of grouping constructs
in the minibuffer.

An annoyance like you reported can be eliminated with the following
simple patch:

Index: lisp/simple.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/simple.el,v
retrieving revision 1.966
diff -u -r1.966 simple.el
--- lisp/simple.el      9 Jan 2009 04:44:21 -0000       1.966
+++ lisp/simple.el      13 Jan 2009 23:28:42 -0000
@@ -5229,7 +5229,9 @@
                  ;; a matching-char info, in which case the two CDRs
                  ;; should match.
                  (eq matching-paren (cdr (syntax-after (1- oldpos))))))
-        (message "Mismatched parentheses"))
+       (if (window-minibuffer-p (selected-window))
+           (minibuffer-message " [Mismatched parentheses]")
+         (message "Mismatched parentheses")))
        ((not blinkpos)
         (or blink-matching-paren-distance
             ;; Don't complain when `$' with no blinkpos, because it

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]