[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: a bug in font lock for c++ code
From: |
zwz |
Subject: |
Re: a bug in font lock for c++ code |
Date: |
Thu, 24 Jun 2010 11:23:56 +0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (windows-nt) |
Alan Mackenzie <address@hidden> writes:
> Hi, zwz,
>
> Thanks for the bug report.
>
> On Mon, Jun 14, 2010 at 03:15:40PM +0000, zwz wrote:
>> I find that my c++ code does not show in color after an update of
> emacs
>> recently.
>
>> As far as I can figure out, the problem can be reproduced by:
>> (defun my-c-mode-common-hook()
>> (font-lock-add-keywords nil
>> '(("\\<\\(FIXME\\):" 1 font-lock-warning-face prepend)
>> ("\\<\\(and\\|or\\|not\\)\\>" .
>> font-lock-keyword-face))))
>> (add-hook 'c++-mode-hook 'my-c-mode-common-hook)
>
>> I am running GNU Emacs 24.0.50.1 (i386-mingw-nt6.0.6002) of
> 2010-05-21.
>
> Any chance you could provide a sample (preferably small) of C++ code
> where the fontification goes wrong?
Yes. Here is what I do
1. start the emacs with "emacs -q"
2. eval the code described above
3. create a new buffer, say main.cpp (or any buffer with c++-mode enabled)
4. insert into the buffer:
int main()
{}
5. you should see that there is no color for the type "int" or the
function name "main"