Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

syntax highlighting (cc-mode)

410 views
Skip to first unread message

Fab Wermelinger

unread,
Sep 12, 2011, 2:14:36 AM9/12/11
to
Hello folks

I use emacs a lot to edit c++. I've noticed, that emacs does not
highlight syntax properly (e.g. types, function names, etc). I'm aware
of lazy-lock, but it seems that it does not improve the behavior.
Anyone encountered the same problem and might know a solution to it?

thanks
Fab

Eric Pement

unread,
Sep 12, 2011, 10:13:39 AM9/12/11
to
On Sep 12, 1:14 am, Fab Wermelinger <fab4...@gmail.com> wrote:

> I use emacs a lot to edit c++. I've noticed, that emacs does not
> highlight syntax properly (e.g. types, function names, etc). I'm aware
> of lazy-lock, but it seems that it does not improve the behavior.

When c-mode or cc-mode is active, type 'M-x c-version' to determine
the current version of CC Mode.

The latest version is 5.32.1, and it contains fixes to previous syntax
highlighting issues.

To upgrade, visit http://cc-mode.sourceforge.net


Alan Mackenzie

unread,
Sep 12, 2011, 11:32:45 AM9/12/11
to
Eric Pement <eric....@gmail.com> wrote:
> On Sep 12, 1:14?am, Fab Wermelinger <fab4...@gmail.com> wrote:
>
> When c-mode or cc-mode is active, type 'M-x c-version' to determine
> the current version of CC Mode.
>
> The latest version is 5.32.1, and it contains fixes to previous syntax
> highlighting issues.

Hey, my hero! 5.32.1's only been up a couple of hours. You're quick off
the mark. :-)

> To upgrade, visit http://cc-mode.sourceforge.net

--
Alan Mackenzie (Nuremberg, Germany).

Alan Mackenzie

unread,
Sep 12, 2011, 11:37:53 AM9/12/11
to
Any chance you could say more exactly what's wrong? Do you mean, for
example that the wrong colour is being used on these tokens?

In a modern Emacs, jit-lock rather than lazy-lock is used for fontification.
In XEmacs, lazy-lock is still used.

What version of (X)Emacs are you using (M-x emacs-version) and what version
of CC Mode (M-x c-version)?

> thanks
> Fab

Fab Wermelinger

unread,
Sep 13, 2011, 2:03:01 AM9/13/11
to
On Sep 12, 5:37 pm, Alan Mackenzie <a...@muc.de> wrote:

I use Emacs 23.1.1 and CC Mode 5.31.7

The behavior is such that I think Emacs does not update fontification
too frequent. For example, I have function names printed in bold pink
when they are declared. Sometimes, when two declarations are visible
on the screen, one function name is highlighted while the other is
not. I can fix this anytime by invoking M-x font-lock-fontify-buffer,
but this is rather Emacs' job than mine..

I might give a try what Eric said.

I appreciate all the feedback!

Fab

Fab Wermelinger

unread,
Sep 13, 2011, 3:17:55 AM9/13/11
to
I was lacking behind... the update did the trick!

Thank you
Fab

Fab Wermelinger

unread,
Sep 16, 2011, 7:43:23 AM9/16/11
to
after I have worked a while with version 5.32.1, it starts to act
weird on uncommenting regions, i.e., the uncommented code remains
printed in the color of comments. Has anybody else encountered this
issue? (When I close emacs and start a new session, everything works
fine again)

regards
Fab

Fab Wermelinger

unread,
Sep 16, 2011, 6:57:38 AM9/16/11
to
Ok, me again..

After I was using version 5.32.1 for some time, I've noticed that cc-
mode acts weird on uncommenting regions, the uncommented code remains
printed in the colors of comments. If I close emacs and start it up
again, everything works fine again? has anybody also encountered this
issue?

regards
Fab

Alan Mackenzie

unread,
Sep 17, 2011, 12:09:05 PM9/17/11
to
Fab Wermelinger <fab...@gmail.com> wrote:
> On Sep 13, 9:17?am, Fab Wermelinger <fab4...@gmail.com> wrote:
>> On Sep 12, 4:13?pm, Eric Pement <eric.pem...@gmail.com> wrote:

>> > On Sep 12, 1:14?am, Fab Wermelinger <fab4...@gmail.com> wrote:

>> > > I use emacs a lot to edit c++. I've noticed, that emacs does not
>> > > highlight syntax properly (e.g. types, function names, etc). I'm aware
>> > > of lazy-lock, but it seems that it does not improve the behavior.

>> > When c-mode or cc-mode is active, type 'M-x c-version' to determine
>> > the current version of CC Mode.

>> > The latest version is 5.32.1, and it contains fixes to previous syntax
>> > highlighting issues.

>> > To upgrade, visithttp://cc-mode.sourceforge.net

>> I was lacking behind... the update did the trick!

>> Thank you
>> Fab

> Ok, me again..

Hi!

> After I was using version 5.32.1 for some time, I've noticed that cc-
> mode acts weird on uncommenting regions, the uncommented code remains
> printed in the colors of comments. If I close emacs and start it up
> again, everything works fine again? has anybody also encountered this
> issue?

Not yet, so far as I know. Could you please submit a bug report to
bug-c...@gnu.org. To do this, do C-c C-b from your C++ buffer. This
will create a dump of CC Mode's current configuration. Please enclose a
small piece of code where the error happens and say exactly what you do
to make it fail (down to the level of which keys you press).

Either send off the email buffer (if you use Emacs's facilities) or cut
and paste all this into the email client you use and send it to
bug-c...@gnu.org.

Then I'll see if I can get this fixed for 5.32.2. :-)

Thanks in advance!

> regards

Fab Wermelinger

unread,
Sep 19, 2011, 7:24:15 AM9/19/11
to
On Sep 17, 6:09 pm, Alan Mackenzie <a...@muc.de> wrote:
> Fab Wermelinger <fab4...@gmail.com> wrote:
> > On Sep 13, 9:17?am, Fab Wermelinger <fab4...@gmail.com> wrote:
> >> On Sep 12, 4:13?pm, Eric Pement <eric.pem...@gmail.com> wrote:
> >> > On Sep 12, 1:14?am, Fab Wermelinger <fab4...@gmail.com> wrote:
> >> > > I use emacs a lot to edit c++. I've noticed, that emacs does not
> >> > > highlight syntax properly (e.g. types, function names, etc). I'm aware
> >> > > of lazy-lock, but it seems that it does not improve the behavior.
> >> > When c-mode or cc-mode is active, type 'M-x c-version' to determine
> >> > the current version of CC Mode.
> >> > The latest version is 5.32.1, and it contains fixes to previous syntax
> >> > highlighting issues.
> >> > To upgrade, visithttp://cc-mode.sourceforge.net
> >> I was lacking behind... the update did the trick!
> >> Thank you
> >> Fab
> > Ok, me again..
>
> Hi!
>
> > After I was using version 5.32.1 for some time, I've noticed that cc-
> > mode acts weird on uncommenting regions, the uncommented code remains
> > printed in the colors of comments. If I close emacs and start it up
> > again, everything works fine again? has anybody also encountered this
> > issue?
>
> Not yet, so far as I know.  Could you please submit a bug report to
> bug-cc-m...@gnu.org.  To do this, do C-c C-b from your C++ buffer.  This

> will create a dump of CC Mode's current configuration.  Please enclose a
> small piece of code where the error happens and say exactly what you do
> to make it fail (down to the level of which keys you press).
>
> Either send off the email buffer (if you use Emacs's facilities) or cut
> and paste all this into the email client you use and send it to
> bug-cc-m...@gnu.org.

>
> Then I'll see if I can get this fixed for 5.32.2.  :-)
>
> Thanks in advance!
>
> > regards
> > Fab
>
> --
> Alan Mackenzie (Nuremberg, Germany).

Thanks Alan

I'm in an internship for 12 weeks (starting today) and I will not work
on that C++ project, however, I will do what you said as soon as I
continue to work on it again.

regards
Fab

0 new messages