🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #87264

[19.27]: font-lock confused by /********/ comment

#87264
From: Kevin Broadey
Date: Fri, 07 Oct 1994 11:56
44 lines
2126 bytes
In GNU Emacs 19.27.3 (rs6000-ibm-aix3.2.5, X toolkit) of Fri Sep 23 1994
on mended_drum

This one's been bothering me for ages and I've finally tracked it
down...

Start up emacs -q -no-site-file (just to make sure it's clean) and
edit the file c.c which contains the following code:-

--  c.c  -------------------------------------------------------------

int main (int argc, char *argv[])
{
  printf ("Hello world!\n");

  /*******/

  printf ("Hello world!\n");
}

----------------------------------------------------------------------

Now do M-x font-lock-mode.  The string after the first printf gets
fontified as expected (in the underline face) as does the comment (in
italics) but the second string *doesn't* get fontified.

This seems to be because `comment-start-skip' is swallowing the start
of the comment end.  You can prove this in two ways:-

(1) change the comment to "/****** */", save the file, revisit it by
    doing C-x C-v RET, then do font-lock-mode.  Everything gets
    fontified as expected.

(2) (with the original "/*******/" comment) turn off font-lock-mode
    with C-u - M-x font-lock-mode RET, change comment-start-skip by
    doing M-x set-variable RET comment-start-skip RET "/\\*" RET, then
    turn on font-lock-mode.  Again, everything gets fontified
    correctly.

I haven't had a chance to look into font-lock.el to see what's going
wrong, but it shouldn't be too difficult to spot.

--
Kevin
Technical Details
Message-ID: <9410051602.AA14619@bartley>
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!howland.reston.ans.net!math.ohio-state.edu!cis.ohio-state.edu!bartley.demon.co.uk!KevinB

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,f80dcc01bd74ade3,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1994-10-07 21:29:13 PST
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!howland.reston.ans.net!math.ohio-state.edu!cis.ohio-state.edu!bartley.demon.co.uk!KevinB
From: KevinB@bartley.demon.co.uk (Kevin Broadey)
Newsgroups: gnu.emacs.bug
Subject: [19.27]: font-lock confused by /********/ comment
Date: 7 Oct 1994 07:56:47 -0400
Organization: GNUs Not Usenet
Lines: 44
Sender: daemon@cis.ohio-state.edu
Approved: bug-gnu-emacs@prep.ai.mit.edu
Distribution: gnu
Message-ID: <9410051602.AA14619@bartley>