unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Jan Djärv" <jan.h.d@swipnet.se>
To: Glenn Morris <rgm@gnu.org>
Cc: "blew@astro.uni.torun.pl" <blew@astro.uni.torun.pl>,
	"5422@debbugs.gnu.org" <5422@debbugs.gnu.org>
Subject: bug#5422: syntax highlighting bug
Date: Tue, 4 Oct 2011 07:32:57 +0200	[thread overview]
Message-ID: <9AFE9713-A3D7-49B9-BF21-920F91C067EF@swipnet.se> (raw)
In-Reply-To: <kqfwj9aj16.fsf@fencepost.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.




  parent reply	other threads:[~2011-10-04  5:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2011-10-04 13:11     ` Michael Welsh Duggan
2011-10-06 15:38     ` Alan Mackenzie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9AFE9713-A3D7-49B9-BF21-920F91C067EF@swipnet.se \
    --to=jan.h.d@swipnet.se \
    --cc=5422@debbugs.gnu.org \
    --cc=blew@astro.uni.torun.pl \
    --cc=rgm@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).