GNU bug report logs -
#9448
24.0.50; Comments in Awk scripts not fontified with comment face
Previous Next
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
Hi, all.
On Wed, Sep 07, 2011 at 05:01:47PM +0000, Alan Mackenzie wrote:
> > emacs -Q
> > C-x C-f foo.awk RET
> > Type "# something" (without quotes). The comment is not highlighted
> > in the font-lock-comment face, as expected. comment-start and
> > comment-start-skip seem to have reasonable values.
> A bit of binary chopping shows that the bug first became visible after
> this change:
> revno: 104401
> committer: Chong Yidong <cyd <at> stupidchicken.com>
> branch nick: trunk
> timestamp: Sat 2011-05-28 13:16:54 -0400
> message:
> Make CC modes inherit from prog-mode.
> * lisp/progmodes/cc-mode.el (c-mode, c++-mode, objc-mode, java-mode)
> (idl-mode, pike-mode, awk-mode): Inherit from prog-mode.
> I cannot see anything in the change with looks remotely suspicious,
> however. Except, of course, that AWK Mode is now constructed by a macro
> of some complexity, doubly invoked.
I think I see the problem, it's with the macro `define-derived-mode'.
This creates an empty syntax table with (defvar awk-mode-syntax-table),
and does this before cc-awk.elc has been loaded. This thus stuffs the
proper definition of awk-mode-syntax-table.
Because of this, ?# doesn't have the open-comment syntax flag, thus
comments can't get fontified.
If I'm right about this, a solution would be to insert
(makunbound 'awk-mode-syntax-table)
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? Maybe this should be taken out of the macro.
> Deleting cc-fonts.elc (thus allowing cc-fonts.el to be loaded) gets
> fontification of AWK comments working for me, too.
I still don't have a clue why this is happening.
--
Alan Mackenzie (Nuremberg, Germany).
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.