Subject: Re: bug#9448: 24.0.50; Comments in Awk scripts not fontified with comment face

From: Stefan Monnier <[email-masked]>
Date: Wed, 07 Sep 2011 22:12:40 -0400

> If I'm right about this, a solution would be to insert
>    (makunbound 'awk-mode-syntax-table)

I wouldn't consider this as a solution.  I see a few solutions, tho:
- move the defvar from cc-awk to cc-mode.
- move the define-derived-mode to cc-awk (sounds natural, from my
  "I haven't looked at the code" point of view).
- add a ":syntax-table awk-mode-syntax-table" argument to define-derived-mode.

> at the top of the mode initialisation.  Why on earth does
> `define-derived-mode' have the temerity to create an empty, thus useless,
> syntax table?

It's actually not empty: it inherits from the parent.  This is taken
directly from the original define-derived-mode, which was oddly meant
for end-users.
It also has the advantage to ensure that every major-mode defined with
define-derived-mode will have a foo-mode-syntax-table.

> Maybe this should be taken out of the macro.

Maybe so, yes.  I'm not completely sure.  In any case it's too late to
do that for Emacs-24.  But we could try it out in Emacs-25.

        Stefan