From: Alan Mackenzie <acm@muc.de>
To: 9448@debbugs.gnu.org
Subject: bug#9448: 24.0.50; Comments in Awk scripts not fontified with comment face
Date: Wed, 7 Sep 2011 18:14:29 +0000 [thread overview]
Message-ID: <20110907181429.GB5076@acm.acm> (raw)
In-Reply-To: <20110907170147.GA5076@acm.acm>
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@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).
next prev parent reply other threads:[~2011-09-07 18:14 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-06 4:27 bug#9448: 24.0.50; Comments in Awk scripts not fontified with comment face Eli Zaretskii
2011-09-07 7:51 ` Glenn Morris
2011-09-07 16:30 ` Eli Zaretskii
2011-09-07 17:01 ` bug#9448: asdf Alan Mackenzie
2011-09-07 18:14 ` Alan Mackenzie [this message]
2011-09-08 2:12 ` bug#9448: 24.0.50; Comments in Awk scripts not fontified with comment face Stefan Monnier
2011-09-08 6:16 ` Glenn Morris
2011-09-08 8:33 ` Alan Mackenzie
2011-09-08 18:36 ` Glenn Morris
2011-09-08 21:13 ` Alan Mackenzie
2011-09-09 7:01 ` Eli Zaretskii
2011-09-09 9:38 ` Alan Mackenzie
2011-09-09 10:02 ` Alan Mackenzie
2011-09-07 19:17 ` Glenn Morris
2011-09-08 21:50 ` Glenn Morris
2011-09-08 22:13 ` Alan Mackenzie
2011-09-09 2:27 ` Stefan Monnier
2011-09-09 7:04 ` Eli Zaretskii
2011-09-09 7:12 ` Glenn Morris
2011-09-09 7:19 ` Glenn Morris
2011-09-09 3:44 ` Glenn Morris
2011-09-09 9:56 ` bug#9448: Bug fixed Alan Mackenzie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110907181429.GB5076@acm.acm \
--to=acm@muc.de \
--cc=9448@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).