GNU bug report logs - #9448
24.0.50; Comments in Awk scripts not fontified with comment face

Previous Next

Packages: emacs, cc-mode;

Reported by: Eli Zaretskii <eliz <at> gnu.org>

Date: Tue, 6 Sep 2011 04:32:02 UTC

Severity: normal

Found in version 24.0.50

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 9448 <at> debbugs.gnu.org
Subject: bug#9448: 24.0.50; Comments in Awk scripts not fontified with comment face
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




This bug report was last modified 13 years and 338 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.