help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C and C++ highlighting is not working properly (font-lock)


From: Alan Mackenzie
Subject: Re: C and C++ highlighting is not working properly (font-lock)
Date: Sun, 1 Jul 2007 18:50:55 +0100
User-agent: Mutt/1.5.9i

Hi!

On Sun, Jul 01, 2007 at 03:07:29PM -0000, deccard wrote:
> On 30 kes?, 13:13, Alan Mackenzie <a...@muc.de> wrote:
> > Hi!
> >
> > That looks wierd.
> >
> > OK.  To begin with, can you tell me EXACTLY what I have to do to
> > reproduce the problem, beginning with how you start Emacs?

> I'm using emacs through ssh connection on my university's server. The
> problem may lay on their end of the line. So maybe I should direct my
> university's Unix administrator here. I just was wondering if I'm
> doing something wrong.

Ah, ssh!  I don't think you're doing anything wrong at all.  The colours
on your buffer are just so wierd that I don't think it's (solely) Emacs.
However, they're not totally random, either.

> I get the problem very simple way. I start emacs (gemacs myproc.cc)
> and enable the "Syntax Highlighting (Global Font Lock mode)" (F10 s o)

OK.

> > Does it happen as you're
> > typing the C++ program, or when you load an existing C++ file?

> The problem occurs in both cases.

Further evidence that it's possibly not Emacs at fault.

> > It's always best with problems like this to say explicitly what
> > version of Emacs you're using (M-x emacs-version).

> As you can see from the screen shot the version is GNU emacs 21.3.4
> (x86_64-redhat-linux-gnu, X toolkit, Xaw3d scroll bars).
 
Sorry, yes I missed that.
 
> > Often, it's good to dump CC Mode's configuration (C-c C-b); this can
> > be _very_ helpful in diagnosing bugs.

> huh? dump Mode's configuration? Sorry, but I'm pretty new to emacs

Sorry again, I should have explained better.  Welcome to Emacs!

The "major mode" you're in determines the way Emacs works.  For example,
when you're in "Text Mode", Emacs behaves differently from when you're
in "C++ Mode", or "Makefile Mode".  The mode you're in is displayed on
the "Modeline", the second bottom line on your screen.  In your screen
dump, you were in C++ Mode.

"CC Mode" is a family of seven modes for editing C, C++, Java, Objective
C, IDL, Pike and AWK.  In each of them the key binding C-c C-b ("Ctrl-C
followed by Ctrl-B") will create a template bug-report form.  This form
contains the values of the (Lisp) variables which are the CC Mode
configuration.  For some bugs this is VERY helpful for fixing them.  But
I don't think it would help here, though.

> > > I have not added anything to my .emacs.
> >
> > Hmmm.  Since when?  What was in it before you didn't add anything to it?
> > ;-)  If you start emacs with "emacs -q", does the problem go away?
> >
> > Do you have a site-start file (M-x locate-library <CR> site-start.el
> > <CR>)?  If so, what happens when you start emacs with "emacs -q
> > --no-site-file"?
> >

> I meant that I don't have .emacs file at all. I deleted it when I
> noticed the problem, because I wanted to be sure that I had not caused
> the problem by goofing around with it.
 
Ah, OK.
 
> And No, the problem still comes about with "gemacs -q" as well as
> "gemacs -q --no-site-file".

It looks to me like there's something weird happening on your ssh link.
I think your best bet would be to ask your sysadmin for help - show him
the emails/usenet postings from this thread.

Hope you get it sorted out soon.

-- 
Alan Mackenzie (Ittersbach, Germany).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]