all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* a bug in font lock for c++ code
@ 2010-06-14 15:15 zwz
  2010-06-23 20:49 ` Alan Mackenzie
  0 siblings, 1 reply; 3+ messages in thread
From: zwz @ 2010-06-14 15:15 UTC (permalink / raw)
  To: emacs-devel

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.




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

* Re: a bug in font lock for c++ code
  2010-06-14 15:15 a bug in font lock for c++ code zwz
@ 2010-06-23 20:49 ` Alan Mackenzie
  2010-06-24  3:23   ` zwz
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Mackenzie @ 2010-06-23 20:49 UTC (permalink / raw)
  To: zwz; +Cc: emacs-devel

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?

-- 
Alan Mackenzie (Nuremberg, Germany).



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

* Re: a bug in font lock for c++ code
  2010-06-23 20:49 ` Alan Mackenzie
@ 2010-06-24  3:23   ` zwz
  0 siblings, 0 replies; 3+ messages in thread
From: zwz @ 2010-06-24  3:23 UTC (permalink / raw)
  To: emacs-devel

Alan Mackenzie <acm@muc.de> 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"




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

end of thread, other threads:[~2010-06-24  3:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-14 15:15 a bug in font lock for c++ code zwz
2010-06-23 20:49 ` Alan Mackenzie
2010-06-24  3:23   ` zwz

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.