unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#5422: syntax highlighting bug
@ 2010-01-19 12:21 Bartosz Lew
  2011-10-03 20:59 ` Glenn Morris
  0 siblings, 1 reply; 6+ messages in thread
From: Bartosz Lew @ 2010-01-19 12:21 UTC (permalink / raw)
  To: bug-gnu-emacs

Hi,

This is just to report on some minor C++ syntax highlighting problem in emacs.

when I write:

	if (a < b->c())  { do this; } else { do that; }

two two things go wrong:
1) parentheses matching doesn't work correctly 
	emacs matches the closing bracket of the if condition with the "<" - "smaller 
than" sign in the if condition.

2) the automatic positioning of any code written below gets confused due to 
this parentheses matching problem.

I use:

 GNU Emacs 23.1.1 (i386-redhat-linux-gnu, GTK+ Version 2.16.6)
 of 2009-09-29 on x86-7.fedora.phx.redhat.com

Hope this is of any use.
Cheers,
Bart










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

* bug#5422: syntax highlighting bug
  2010-01-19 12:21 bug#5422: syntax highlighting bug Bartosz Lew
@ 2011-10-03 20:59 ` Glenn Morris
  2011-10-03 21:24   ` Bartosz Lew
  2011-10-04  5:32   ` Jan Djärv
  0 siblings, 2 replies; 6+ messages in thread
From: Glenn Morris @ 2011-10-03 20:59 UTC (permalink / raw)
  To: blew; +Cc: 5422

Bartosz Lew wrote:

> This is just to report on some minor C++ syntax highlighting problem
> in emacs.
>
> when I write:
>
> 	if (a < b->c())  { do this; } else { do that; }
>
> two two things go wrong:
> 1) parentheses matching doesn't work correctly 
> 	emacs matches the closing bracket of the if condition with the
> "<" - "smaller > than" sign in the if condition.
>
> 2) the automatic positioning of any code written below gets confused due to 
> this parentheses matching problem.
>
> I use:
>
>  GNU Emacs 23.1.1 (i386-redhat-linux-gnu, GTK+ Version 2.16.6)
>  of 2009-09-29 on x86-7.fedora.phx.redhat.com

I am unable to reproduce this in any version of Emacs, including 23.1.
If you still see the problem in the latest release, please send a
complete example starting from emacs -Q.

(There seem to have been some fixes in this area, eg
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=4847 )





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

* bug#5422: syntax highlighting bug
  2011-10-03 20:59 ` Glenn Morris
@ 2011-10-03 21:24   ` Bartosz Lew
  2011-10-04  5:32   ` Jan Djärv
  1 sibling, 0 replies; 6+ messages in thread
From: Bartosz Lew @ 2011-10-03 21:24 UTC (permalink / raw)
  To: Glenn Morris


Thanks for the email.

Well, I don't see this behaviour now either but now I'm working 
on 
Emacs 23.2.1 (x86_64-redhat-linux-gnu, GTK+ Version 2.24.4)
of 2011-05-23 on x86-12.phx2.fedoraproject.org
installed on a new computer.

I sent the bug report one laptop ago and that computer has crushed,
so I cannot easily go back to that configuration without system reinstall.

Anyway, everything seems fine with my current version.
Thanks again.
Bartek.

On Monday 03 of October 2011 22:59:17 you wrote:
> Bartosz Lew wrote:
> > This is just to report on some minor C++ syntax highlighting problem
> > in emacs.
> > 
> > when I write:
> > 	if (a < b->c())  { do this; } else { do that; }
> > 
> > two two things go wrong:
> > 1) parentheses matching doesn't work correctly
> > 
> > 	emacs matches the closing bracket of the if condition with the
> > 
> > "<" - "smaller > than" sign in the if condition.
> > 
> > 2) the automatic positioning of any code written below gets confused due
> > to this parentheses matching problem.
> > 
> > I use:
> >  GNU Emacs 23.1.1 (i386-redhat-linux-gnu, GTK+ Version 2.16.6)
> >  of 2009-09-29 on x86-7.fedora.phx.redhat.com
> 
> I am unable to reproduce this in any version of Emacs, including 23.1.
> If you still see the problem in the latest release, please send a
> complete example starting from emacs -Q.
> 
> (There seem to have been some fixes in this area, eg
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=4847 )





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

* bug#5422: syntax highlighting bug
  2011-10-03 20:59 ` Glenn Morris
  2011-10-03 21:24   ` Bartosz Lew
@ 2011-10-04  5:32   ` Jan Djärv
  2011-10-04 13:11     ` Michael Welsh Duggan
  2011-10-06 15:38     ` Alan Mackenzie
  1 sibling, 2 replies; 6+ messages in thread
From: Jan Djärv @ 2011-10-04  5:32 UTC (permalink / raw)
  To: Glenn Morris; +Cc: blew@astro.uni.torun.pl, 5422@debbugs.gnu.org

Hello.


3 okt 2011 kl. 22:59 skrev Glenn Morris <rgm@gnu.org>:

> Bartosz Lew wrote:
> 
>> This is just to report on some minor C++ syntax highlighting problem
>> in emacs.
>> 
>> when I write:
>> 
>>    if (a < b->c())  { do this; } else { do that; }
>> 
>> two two things go wrong:
>> 1) parentheses matching doesn't work correctly 
>>    emacs matches the closing bracket of the if condition with the
>> "<" - "smaller > than" sign in the if condition.
>> 
>> 2) the automatic positioning of any code written below gets confused due to 
>> this parentheses matching problem.
>> 
>> I use:
>> 
>> GNU Emacs 23.1.1 (i386-redhat-linux-gnu, GTK+ Version 2.16.6)
>> of 2009-09-29 on x86-7.fedora.phx.redhat.com
> 
> I am unable to reproduce this in any version of Emacs, including 23.1.
> If you still see the problem in the latest release, please send a
> complete example starting from emacs -Q.
> 
> (There seem to have been some fixes in this area, eg
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=4847 )
> 

This is one of the elusive cc-mode bugs that isn't easy to reproduce. 

AFAIK it depends on some cache in cc-mode getting out of sync. So you are more likely to see it on a large file you have edited in several places. It might even depend on what kind of editing you have done. I think this is a symptom of some underlying bug.

I see this in 23.3 and the trunk at least 2-3 times per day when editing code with a lot of templates. The < and > are mistaken for start/end brace or parentesis.

Save the file, kill the buffer, and reopen the file usually fixes it.

    Jan D.




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

* bug#5422: syntax highlighting bug
  2011-10-04  5:32   ` Jan Djärv
@ 2011-10-04 13:11     ` Michael Welsh Duggan
  2011-10-06 15:38     ` Alan Mackenzie
  1 sibling, 0 replies; 6+ messages in thread
From: Michael Welsh Duggan @ 2011-10-04 13:11 UTC (permalink / raw)
  To: Jan Djärv; +Cc: blew@astro.uni.torun.pl, 5422@debbugs.gnu.org

Jan Djärv <jan.h.d@swipnet.se> writes:

> Hello.
>
>
> 3 okt 2011 kl. 22:59 skrev Glenn Morris <rgm@gnu.org>:
>
>> Bartosz Lew wrote:
>> 
>>> This is just to report on some minor C++ syntax highlighting problem
>>> in emacs.

[...]

>> 
>> I am unable to reproduce this in any version of Emacs, including 23.1.
>> If you still see the problem in the latest release, please send a
>> complete example starting from emacs -Q.
>> 
>> (There seem to have been some fixes in this area, eg
>> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=4847 )
>> 
>
> This is one of the elusive cc-mode bugs that isn't easy to reproduce. 
>
> AFAIK it depends on some cache in cc-mode getting out of sync. So you
> are more likely to see it on a large file you have edited in several
> places. It might even depend on what kind of editing you have done. I
> think this is a symptom of some underlying bug.
>
> I see this in 23.3 and the trunk at least 2-3 times per day when
> editing code with a lot of templates. The < and > are mistaken for
> start/end brace or parentesis.
>
> Save the file, kill the buffer, and reopen the file usually fixes it.

I have been having similar problems, and am really hoping this gets
fixed in the pretest.  I have an open bug (9560) which contains
information which hopefully can reproduce at least one of these cache
inconsistency errors.

-- 
Michael Welsh Duggan
(md5i@md5i.com)





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

* bug#5422: syntax highlighting bug
  2011-10-04  5:32   ` Jan Djärv
  2011-10-04 13:11     ` Michael Welsh Duggan
@ 2011-10-06 15:38     ` Alan Mackenzie
  1 sibling, 0 replies; 6+ messages in thread
From: Alan Mackenzie @ 2011-10-06 15:38 UTC (permalink / raw)
  To: Jan Djärv; +Cc: blew@astro.uni.torun.pl, 5422@debbugs.gnu.org

On Tue, Oct 04, 2011 at 07:32:57AM +0200, Jan Djärv wrote:
> Hello.


> 3 okt 2011 kl. 22:59 skrev Glenn Morris <rgm@gnu.org>:

> > Bartosz Lew wrote:

> >> This is just to report on some minor C++ syntax highlighting problem
> >> in emacs.

> >> when I write:

> >>    if (a < b->c())  { do this; } else { do that; }

> >> two two things go wrong:
> >> 1) parentheses matching doesn't work correctly 
> >>    emacs matches the closing bracket of the if condition with the
> >> "<" - "smaller > than" sign in the if condition.

> >> 2) the automatic positioning of any code written below gets confused due to 
> >> this parentheses matching problem.

> >> I use:

> >> GNU Emacs 23.1.1 (i386-redhat-linux-gnu, GTK+ Version 2.16.6)
> >> of 2009-09-29 on x86-7.fedora.phx.redhat.com

> > I am unable to reproduce this in any version of Emacs, including 23.1.
> > If you still see the problem in the latest release, please send a
> > complete example starting from emacs -Q.

> > (There seem to have been some fixes in this area, eg
> > http://debbugs.gnu.org/cgi/bugreport.cgi?bug=4847 )


> This is one of the elusive cc-mode bugs that isn't easy to reproduce. 

> AFAIK it depends on some cache in cc-mode getting out of sync. So you
> are more likely to see it on a large file you have edited in several
> places. It might even depend on what kind of editing you have done. I
> think this is a symptom of some underlying bug.

> I see this in 23.3 and the trunk at least 2-3 times per day when
> editing code with a lot of templates. The < and > are mistaken for
> start/end brace or parentesis.

The < and > are marked (with syntax-table text properties) as parens when
they "look like" template brackets, as they sort of do in the OP's code.
Many moons ago, < and > got marked as parens individually.  Now they are
only marked in pairs.

This has quite likely fixed the OP's bug.

> Save the file, kill the buffer, and reopen the file usually fixes it.

Yes.  But that "shouldn't" be necessary any more.

>     Jan D.

-- 
Alan Mackenzie (Nuremberg, Germany).





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

end of thread, other threads:[~2011-10-06 15:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-19 12:21 bug#5422: syntax highlighting bug Bartosz Lew
2011-10-03 20:59 ` Glenn Morris
2011-10-03 21:24   ` Bartosz Lew
2011-10-04  5:32   ` Jan Djärv
2011-10-04 13:11     ` Michael Welsh Duggan
2011-10-06 15:38     ` Alan Mackenzie

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