unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#5122: Mismatched parentheses when dealing with huge buffercontent
  2009-12-04 15:31 bug#5122: Mismatched parentheses when dealing with huge buffer content Deniz Dogan
@ 2009-12-04 22:27 ` Drew Adams
  2009-12-05  0:27   ` Deniz Dogan
  0 siblings, 1 reply; 20+ messages in thread
From: Drew Adams @ 2009-12-04 22:27 UTC (permalink / raw)
  To: 'Deniz Dogan', 5122, emacs-pretest-bug

See option `blink-matching-paren-distance' and node Matching in the Emacs
manual.

Does increasing that variable's value resolve the problem? 






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

* bug#5122: Mismatched parentheses when dealing with huge buffercontent
  2009-12-04 22:27 ` bug#5122: Mismatched parentheses when dealing with huge buffercontent Drew Adams
@ 2009-12-05  0:27   ` Deniz Dogan
  2009-12-05  0:31     ` Drew Adams
  0 siblings, 1 reply; 20+ messages in thread
From: Deniz Dogan @ 2009-12-05  0:27 UTC (permalink / raw)
  To: Drew Adams; +Cc: emacs-pretest-bug, 5122

2009/12/4 Drew Adams <drew.adams@oracle.com>:
> See option `blink-matching-paren-distance' and node Matching in the Emacs
> manual.
>
> Does increasing that variable's value resolve the problem?
>
>

Yes, it does solve the problem.

-- 
Deniz Dogan





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

* bug#5122: Mismatched parentheses when dealing with huge buffercontent
  2009-12-05  0:27   ` Deniz Dogan
@ 2009-12-05  0:31     ` Drew Adams
  2009-12-05  0:35       ` Deniz Dogan
  2009-12-05  9:27       ` Eli Zaretskii
  0 siblings, 2 replies; 20+ messages in thread
From: Drew Adams @ 2009-12-05  0:31 UTC (permalink / raw)
  To: 'Deniz Dogan'; +Cc: emacs-pretest-bug, 5122

> > See option `blink-matching-paren-distance' and node 
> > Matching in the Emacs manual.
> > Does increasing that variable's value resolve the problem?
> 
> Yes, it does solve the problem.

It's not real obvious when you see mismatch highlighting (and are used to it
working) that the highlighting might not mean a mismatch at all, but just an
insufficiently large option value. Many (most?) users will not even guess that
there is such an option.

Perhaps we could use a :help-echo property along with the mismatch highlight
face, pointing to the option?






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

* bug#5122: Mismatched parentheses when dealing with huge buffercontent
  2009-12-05  0:31     ` Drew Adams
@ 2009-12-05  0:35       ` Deniz Dogan
  2009-12-05  9:27       ` Eli Zaretskii
  1 sibling, 0 replies; 20+ messages in thread
From: Deniz Dogan @ 2009-12-05  0:35 UTC (permalink / raw)
  To: Drew Adams; +Cc: emacs-pretest-bug, 5122

2009/12/5 Drew Adams <drew.adams@oracle.com>:
>> > See option `blink-matching-paren-distance' and node
>> > Matching in the Emacs manual.
>> > Does increasing that variable's value resolve the problem?
>>
>> Yes, it does solve the problem.
>
> It's not real obvious when you see mismatch highlighting (and are used to it
> working) that the highlighting might not mean a mismatch at all, but just an
> insufficiently large option value. Many (most?) users will not even guess that
> there is such an option.
>
> Perhaps we could use a :help-echo property along with the mismatch highlight
> face, pointing to the option?
>
>

I'm not sure what the best solution would be, but it is indeed strange
that Emacs says that there was a parenthesis *mismatch*. Maybe it
would be better to say something along the lines of "Emacs was unable
to find a matching parenthesis in the previous X characters", but
obviously much more terse.





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

* bug#5122: Mismatched parentheses when dealing with huge buffercontent
  2009-12-05  0:31     ` Drew Adams
  2009-12-05  0:35       ` Deniz Dogan
@ 2009-12-05  9:27       ` Eli Zaretskii
  2009-12-05 16:10         ` Drew Adams
  1 sibling, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2009-12-05  9:27 UTC (permalink / raw)
  To: Drew Adams, 5122; +Cc: deniz.a.m.dogan

> From: "Drew Adams" <drew.adams@oracle.com>
> Date: Fri, 4 Dec 2009 16:31:51 -0800
> Cc: emacs-pretest-bug@gnu.org, 5122@emacsbugs.donarmstrong.com
> 
> It's not real obvious when you see mismatch highlighting (and are used to it
> working) that the highlighting might not mean a mismatch at all, but just an
> insufficiently large option value. Many (most?) users will not even guess that
> there is such an option.
> 
> Perhaps we could use a :help-echo property along with the mismatch highlight
> face, pointing to the option?

help-echo is not guaranteed to be seen, and could be tricky when
there's an important message in the echo area (especially if the
help-echo itself is displayed in the echo area).  Also, it will not
work on a text terminal.

I think it's better to modify the echo area message, such that if
Emacs hits the blink-matching-paren-distance limit (as opposed to
hitting point-min), the message says something like

  Mismatched parentheses (within blink-matching-paren-distance)





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

* bug#5122: Mismatched parentheses when dealing with huge buffercontent
  2009-12-05  9:27       ` Eli Zaretskii
@ 2009-12-05 16:10         ` Drew Adams
  0 siblings, 0 replies; 20+ messages in thread
From: Drew Adams @ 2009-12-05 16:10 UTC (permalink / raw)
  To: 'Eli Zaretskii', 5122; +Cc: deniz.a.m.dogan

> > It's not real obvious when you see mismatch highlighting 
> (and are used to it
> > working) that the highlighting might not mean a mismatch at 
> all, but just an
> > insufficiently large option value. Many (most?) users will 
> not even guess that
> > there is such an option.
> > 
> > Perhaps we could use a :help-echo property along with the 
> mismatch highlight
> > face, pointing to the option?
> 
> help-echo is not guaranteed to be seen, and could be tricky when
> there's an important message in the echo area (especially if the
> help-echo itself is displayed in the echo area).  Also, it will not
> work on a text terminal.
> 
> I think it's better to modify the echo area message, such that if
> Emacs hits the blink-matching-paren-distance limit (as opposed to
> hitting point-min), the message says something like
> 
>   Mismatched parentheses (within blink-matching-paren-distance)

Yes that sounds good too.

To be honest, I don't know if I ever noticed any message in the echo area for
this. Perhaps because the message was so expected I never paid any attention to
it.






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

* bug#5122: Mismatched parentheses when dealing with huge buffercontent
@ 2009-12-05 20:57 Chong Yidong
  2009-12-05 21:42 ` Stefan Monnier
  2009-12-05 21:47 ` Eli Zaretskii
  0 siblings, 2 replies; 20+ messages in thread
From: Chong Yidong @ 2009-12-05 20:57 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 5122

> I think it's better to modify the echo area message, such that if
> Emacs hits the blink-matching-paren-distance limit (as opposed to
> hitting point-min), the message says something like
>
>   Mismatched parentheses (within blink-matching-paren-distance)

Error messages shouldn't be so verbose---they can't spell out every bell
and whistle related to the error.  I prefer leaving things the way they
are.





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

* bug#5122: Mismatched parentheses when dealing with huge buffercontent
  2009-12-05 20:57 Chong Yidong
@ 2009-12-05 21:42 ` Stefan Monnier
  2009-12-05 22:06   ` Chong Yidong
  2009-12-05 21:47 ` Eli Zaretskii
  1 sibling, 1 reply; 20+ messages in thread
From: Stefan Monnier @ 2009-12-05 21:42 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 5122

>> I think it's better to modify the echo area message, such that if
>> Emacs hits the blink-matching-paren-distance limit (as opposed to
>> hitting point-min), the message says something like
>> Mismatched parentheses (within blink-matching-paren-distance)
> Error messages shouldn't be so verbose---they can't spell out every bell
> and whistle related to the error.  I prefer leaving things the way they
> are.

But it should be less definitive: rather than just say authoritatively
"mismatched paren", it should at least be more humble and say "can't
find matching paren".


        Stefan





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

* bug#5122: Mismatched parentheses when dealing with huge buffercontent
  2009-12-05 20:57 Chong Yidong
  2009-12-05 21:42 ` Stefan Monnier
@ 2009-12-05 21:47 ` Eli Zaretskii
  2009-12-05 22:11   ` Chong Yidong
  2009-12-07  2:25   ` Stefan Monnier
  1 sibling, 2 replies; 20+ messages in thread
From: Eli Zaretskii @ 2009-12-05 21:47 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 5122

> From: Chong Yidong <cyd@stupidchicken.com>
> Cc: 5122@emacsbugs.donarmstrong.com
> Date: Sat, 05 Dec 2009 15:57:58 -0500
> 
> > I think it's better to modify the echo area message, such that if
> > Emacs hits the blink-matching-paren-distance limit (as opposed to
> > hitting point-min), the message says something like
> >
> >   Mismatched parentheses (within blink-matching-paren-distance)
> 
> Error messages shouldn't be so verbose---they can't spell out every bell
> and whistle related to the error.

I'd say adding a couple of words is hardly verbose, and certainly
isn't spelling out every detail.

> I prefer leaving things the way they are.

And leave users without a clue? how's that preferable?





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

* bug#5122: Mismatched parentheses when dealing with huge buffercontent
  2009-12-05 21:42 ` Stefan Monnier
@ 2009-12-05 22:06   ` Chong Yidong
  0 siblings, 0 replies; 20+ messages in thread
From: Chong Yidong @ 2009-12-05 22:06 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 5122

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> But it should be less definitive: rather than just say authoritatively
> "mismatched paren", it should at least be more humble and say "can't
> find matching paren".

"No matching paren found" sounds fine.





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

* bug#5122: Mismatched parentheses when dealing with huge buffercontent
  2009-12-05 21:47 ` Eli Zaretskii
@ 2009-12-05 22:11   ` Chong Yidong
  2009-12-06  4:03     ` Eli Zaretskii
  2009-12-07  2:25   ` Stefan Monnier
  1 sibling, 1 reply; 20+ messages in thread
From: Chong Yidong @ 2009-12-05 22:11 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 5122

Eli Zaretskii <eliz@gnu.org> writes:

>> Error messages shouldn't be so verbose---they can't spell out every bell
>> and whistle related to the error.
>
> I'd say adding a couple of words is hardly verbose, and certainly
> isn't spelling out every detail.
>
>> I prefer leaving things the way they are.
>
> And leave users without a clue? how's that preferable?

The circumstances in which the parenthesis are mismatched probably
vastly outweigh the circumstances in which the user wants to change
blink-matching-paren-distance.

So, it is arguably more confusing to the average user if the error
message mumbles something about blink-matching-paren-distance.  For
those who care, it's an apropos search away.





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

* bug#5122: Mismatched parentheses when dealing with huge buffercontent
  2009-12-05 22:11   ` Chong Yidong
@ 2009-12-06  4:03     ` Eli Zaretskii
  2009-12-06 15:30       ` Chong Yidong
  0 siblings, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2009-12-06  4:03 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 5122

> From: Chong Yidong <cyd@stupidchicken.com>
> Cc: 5122@emacsbugs.donarmstrong.com
> Date: Sat, 05 Dec 2009 17:11:09 -0500
> 
> The circumstances in which the parenthesis are mismatched probably
> vastly outweigh the circumstances in which the user wants to change
> blink-matching-paren-distance.

I suggested the modified message text _only_ for those cases where the
search hits the limit.





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

* bug#5122: Mismatched parentheses when dealing with huge buffercontent
  2009-12-06  4:03     ` Eli Zaretskii
@ 2009-12-06 15:30       ` Chong Yidong
  2009-12-06 17:52         ` Eli Zaretskii
  0 siblings, 1 reply; 20+ messages in thread
From: Chong Yidong @ 2009-12-06 15:30 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 5122

Eli Zaretskii <eliz@gnu.org> writes:

>> The circumstances in which the parenthesis are mismatched probably
>> vastly outweigh the circumstances in which the user wants to change
>> blink-matching-paren-distance.
>
> I suggested the modified message text _only_ for those cases where the
> search hits the limit.

How do you distinguish this from the plain old "no mismatched
parenthesis" case?  Like I said, if there is no matching parenthesis
within the search limit (which, btw, has been increased in Emacs 22.3),
in most cases the parentheses really are mismatched.





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

* bug#5122: Mismatched parentheses when dealing with huge buffercontent
  2009-12-06 15:30       ` Chong Yidong
@ 2009-12-06 17:52         ` Eli Zaretskii
  2009-12-06 18:59           ` Chong Yidong
  0 siblings, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2009-12-06 17:52 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 5122

> From: Chong Yidong <cyd@stupidchicken.com>
> Cc: 5122@emacsbugs.donarmstrong.com
> Date: Sun, 06 Dec 2009 10:30:37 -0500
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> The circumstances in which the parenthesis are mismatched probably
> >> vastly outweigh the circumstances in which the user wants to change
> >> blink-matching-paren-distance.
> >
> > I suggested the modified message text _only_ for those cases where the
> > search hits the limit.
> 
> How do you distinguish this from the plain old "no mismatched
> parenthesis" case?

Sorry, I don't understand the question.  What is the "no mismatched
parenthesis" case?

To clarify, my suggestion was to display

  Mismatched parenthesis

if the search hits point-min or point-max without finding a match, or

  Mismatched parenthesis (within blink-matching-paren-distance)

if the search doesn't find a match within
blink-matching-paren-distance.

> Like I said, if there is no matching parenthesis within the search
> limit (which, btw, has been increased in Emacs 22.3), in most cases
> the parentheses really are mismatched.

But we don't know that, unless we searched all the way to the
beginning or end of the buffer.  All we know is that we didn't find a
match within the distance searched.





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

* bug#5122: Mismatched parentheses when dealing with huge buffercontent
  2009-12-06 17:52         ` Eli Zaretskii
@ 2009-12-06 18:59           ` Chong Yidong
  0 siblings, 0 replies; 20+ messages in thread
From: Chong Yidong @ 2009-12-06 18:59 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 5122

Eli Zaretskii <eliz@gnu.org> writes:

>> Like I said, if there is no matching parenthesis within the search
>> limit (which, btw, has been increased in Emacs 22.3), in most cases
>> the parentheses really are mismatched.
>
> But we don't know that, unless we searched all the way to the
> beginning or end of the buffer.  All we know is that we didn't find a
> match within the distance searched.

I understand what you're saying.  But even if there is a "matching"
paren more than 102k characters away (the blink-matching-paren-distance
default), chances are that's a mistake anyway.

Yes, I know the failure condition exists.  But for every user
enlightened by a more verbose error message, I think there will be
hundreds more that will be unnecessarily confused.





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

* bug#5122: Mismatched parentheses when dealing with huge buffercontent
  2009-12-05 21:47 ` Eli Zaretskii
  2009-12-05 22:11   ` Chong Yidong
@ 2009-12-07  2:25   ` Stefan Monnier
  2011-07-13 14:59     ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 20+ messages in thread
From: Stefan Monnier @ 2009-12-07  2:25 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Chong Yidong, 5122

>> I prefer leaving things the way they are.
> And leave users without a clue? how's that preferable?

Clearly, the only real answer is to get rid of
blink-matching-paren-distance.  We could try and do that, maybe using
while-no-input.


        Stefan





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

* bug#5122: Mismatched parentheses when dealing with huge buffercontent
@ 2009-12-08 21:11 MON KEY
  0 siblings, 0 replies; 20+ messages in thread
From: MON KEY @ 2009-12-08 21:11 UTC (permalink / raw)
  To: 5122

For really large groups of parens of type `mismatch-maybe' would it be
possible/reasonable/faster to do a check/balance to the nearest pair
of parens relative
the first 10 Catalan numbers e.g. something like this (or his brethren):

(URL `http://www2.research.att.com/~njas/sequences/A000108')
(URL `http://www2.research.att.com/~njas/sequences/table?a=108&fmt=4')

--
s_P





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

* bug#5122: Mismatched parentheses when dealing with huge buffercontent
  2009-12-07  2:25   ` Stefan Monnier
@ 2011-07-13 14:59     ` Lars Magne Ingebrigtsen
  2011-07-13 16:35       ` Drew Adams
  2011-07-13 17:26       ` Drew Adams
  0 siblings, 2 replies; 20+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-07-13 14:59 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 5122, Chong Yidong

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>> I prefer leaving things the way they are.
>> And leave users without a clue? how's that preferable?
>
> Clearly, the only real answer is to get rid of
> blink-matching-paren-distance.  We could try and do that, maybe using
> while-no-input.

That would be a good long-term solution.

Meanwhile, I've implemented Eli's suggestion of just altering the
message to add " within the limit" if we're limited.  So I'm closing
this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





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

* bug#5122: Mismatched parentheses when dealing with huge buffercontent
  2011-07-13 14:59     ` Lars Magne Ingebrigtsen
@ 2011-07-13 16:35       ` Drew Adams
  2011-07-13 17:26       ` Drew Adams
  1 sibling, 0 replies; 20+ messages in thread
From: Drew Adams @ 2011-07-13 16:35 UTC (permalink / raw)
  To: 'Lars Magne Ingebrigtsen', 'Stefan Monnier'
  Cc: 'Chong Yidong', 'MON KEY', 5122

> Stefan Monnier <monnier@iro.umontreal.ca> writes:
> 
> >>> I prefer leaving things the way they are.
> >>
> >> And leave users without a clue? how's that preferable?
> >
> > Clearly, the only real answer is to get rid of
> > blink-matching-paren-distance.  We could try and do that, 
> > maybe using while-no-input.
> 
> That would be a good long-term solution.
> 
> Meanwhile, I've implemented Eli's suggestion of just altering the
> message to add " within the limit" if we're limited.  So I'm closing
> this bug report.

Stefan says what "clearly, the only real answer" is.
He says that can be tried, and he makes a suggestion how.

So why, if that is clearly the answer, do you close the bug?

Makes no sense.  Is the goal just to close bugs or to fix the problem?

Is someone getting paid by the bug closure or something? ;-)






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

* bug#5122: Mismatched parentheses when dealing with huge buffercontent
  2011-07-13 14:59     ` Lars Magne Ingebrigtsen
  2011-07-13 16:35       ` Drew Adams
@ 2011-07-13 17:26       ` Drew Adams
  1 sibling, 0 replies; 20+ messages in thread
From: Drew Adams @ 2011-07-13 17:26 UTC (permalink / raw)
  To: 'Lars Magne Ingebrigtsen', 'Stefan Monnier'
  Cc: 'Chong Yidong', 'MON KEY', 5122

> Stefan says what "clearly, the only real answer" is.
> He says that can be tried, and he makes a suggestion how.
> 
> So why, if that is clearly the answer, do you close the bug?
> Makes no sense.  Is the goal just to close bugs or to fix the problem?
> Is someone getting paid by the bug closure or something? ;-)

And why close it as `fixed' if Emacs Dev will not fix it?
The problem reported is still there, AFAIK.  Why not `wontfix'?






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

end of thread, other threads:[~2011-07-13 17:26 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-08 21:11 bug#5122: Mismatched parentheses when dealing with huge buffercontent MON KEY
  -- strict thread matches above, loose matches on Subject: below --
2009-12-05 20:57 Chong Yidong
2009-12-05 21:42 ` Stefan Monnier
2009-12-05 22:06   ` Chong Yidong
2009-12-05 21:47 ` Eli Zaretskii
2009-12-05 22:11   ` Chong Yidong
2009-12-06  4:03     ` Eli Zaretskii
2009-12-06 15:30       ` Chong Yidong
2009-12-06 17:52         ` Eli Zaretskii
2009-12-06 18:59           ` Chong Yidong
2009-12-07  2:25   ` Stefan Monnier
2011-07-13 14:59     ` Lars Magne Ingebrigtsen
2011-07-13 16:35       ` Drew Adams
2011-07-13 17:26       ` Drew Adams
2009-12-04 15:31 bug#5122: Mismatched parentheses when dealing with huge buffer content Deniz Dogan
2009-12-04 22:27 ` bug#5122: Mismatched parentheses when dealing with huge buffercontent Drew Adams
2009-12-05  0:27   ` Deniz Dogan
2009-12-05  0:31     ` Drew Adams
2009-12-05  0:35       ` Deniz Dogan
2009-12-05  9:27       ` Eli Zaretskii
2009-12-05 16:10         ` Drew Adams

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).