unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Annoying paren match messages in minibuffer
@ 2009-01-12 12:18 Geoff Gole
  2009-01-12 15:20 ` Stefan Monnier
  2009-01-13 23:28 ` Juri Linkov
  0 siblings, 2 replies; 32+ messages in thread
From: Geoff Gole @ 2009-01-12 12:18 UTC (permalink / raw)
  To: emacs-devel

By default, emacs will display a minibuffer message on seeing the user
type an unmatched paren. This is usually a welcome feature, but can
become annoying when point is in the minibuffer where well-formed
input is not necessarily balanced.

For example:

  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?

--- emacs/lisp/replace.el	2009-01-09 14:01:00.000000000 +0900
+++ /tmp/buffer-content-17773Bqy	2009-01-12 20:33:21.000000000 +0900
@@ -225,12 +225,14 @@

 To customize possible responses, change the \"bindings\" in
`query-replace-map'."
   (interactive
-   (let ((common
-	  (query-replace-read-args
-	   (concat "Query replace"
-		   (if current-prefix-arg " word" "")
-		   (if (and transient-mark-mode mark-active) " in region" ""))
-	   nil)))
+   (let* (blink-matching-paren
+	  show-paren-mode
+	  (common
+	   (query-replace-read-args
+	    (concat "Query replace"
+		    (if current-prefix-arg " word" "")
+		    (if (and transient-mark-mode mark-active) " in region" ""))
+	    nil)))
      (list (nth 0 common) (nth 1 common) (nth 2 common)
 	   ;; These are done separately here
 	   ;; so that command-history will record these expressions




^ permalink raw reply	[flat|nested] 32+ messages in thread
* Re: Annoying paren match messages in minibuffer
@ 2009-01-14 23:16 Chetan Pandya
  0 siblings, 0 replies; 32+ messages in thread
From: Chetan Pandya @ 2009-01-14 23:16 UTC (permalink / raw)
  To: Drew Adams, emacs-devel


> > > I didn't mean for the extra header line to always be present,
> > > just to be created on demand when there's a need for an extra
> > > message in the minibuffer.  Yes, this would move the mode-line
> > > one line up and down when displaying the extra header line in
> > > the minibufer, but that might not be a problem given that it's
> > not such a frequent action.
> > 
> > Oh, I see, then I guess it'd be OK, tho I'd rather see the message
> > *below* rather than *above*.

> I don't have a ready-made opinion on this, but please, whatever you do, keep the
> possibility for programmers to get the current behavior.

> It sounds like we're veering into territory that could well be as annoying, at
> least to some, as the behavior that someone originally found annoying. 

> So, by all means, implement it, play with it, ask others to play with it, and
> maybe even add it to Emacs. It sounds like an idea worth exploring. But please
> don't replace the existing behavior, at least as an option for those who prefer
> it.

> IOW, yes to new, experimental ideas; no to adopting them willy nilly.

Given how much traffic there has been on discussing "message", I tend to agree.
For the people who want to experiment, it is possible to do

(setq messagefn (symbol-function 'message))
(fset 'message 'my-choice-message-function)

So it isn't clear there is any urgency of doing this, unless there are other instances 
where the current behavior is irritable and this solution does not work, but then a 
different solution is needed anyway.

Chetan




^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2009-01-17  2:15 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-12 12:18 Annoying paren match messages in minibuffer Geoff Gole
2009-01-12 15:20 ` Stefan Monnier
2009-01-13  2:26   ` Miles Bader
2009-01-13 14:00     ` Stefan Monnier
2009-01-13 15:55     ` Dan Nicolaescu
2009-01-13 18:27       ` Stefan Monnier
2009-01-13 18:33         ` Dan Nicolaescu
2009-01-14 22:15           ` Stefan Monnier
2009-01-14 22:30             ` Drew Adams
2009-01-13 13:58   ` Geoff Gole
2009-01-13 18:25     ` Stefan Monnier
2009-01-13 23:28 ` Juri Linkov
2009-01-14 13:46   ` Chong Yidong
2009-01-14 14:01     ` Stefan Monnier
2009-01-14 15:29       ` Drew Adams
2009-01-14 21:12         ` Juri Linkov
2009-01-14 21:52           ` Stefan Monnier
2009-01-14 22:22             ` Drew Adams
2009-01-14 23:10               ` Stefan Monnier
2009-01-15  0:52                 ` Drew Adams
2009-01-15  2:41                   ` Stefan Monnier
2009-01-16 19:10                     ` Drew Adams
2009-01-16 20:52                       ` Stefan Monnier
2009-01-16 23:42                         ` Drew Adams
2009-01-17  2:15                           ` Stefan Monnier
2009-01-14 22:13           ` Drew Adams
2009-01-14 21:12       ` Juri Linkov
2009-01-14 21:53         ` Stefan Monnier
2009-01-14 18:56   ` Geoff Gole
2009-01-14 21:14     ` Juri Linkov
2009-01-14 22:20       ` Geoff Gole
  -- strict thread matches above, loose matches on Subject: below --
2009-01-14 23:16 Chetan Pandya

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).