🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #88073

function-name face works wrong in font-lock mode

#88073
From: tim werner
Date: Mon, 08 Aug 1994 05:03
55 lines
2311 bytes
Hi,

It seems that font-lock incoreectly identifies some tokens as function
names, and fails to correctly identify some function names as such.

In emacs-19.25, with "emacs -q" I evaluate the following:

   (if (eq window-system 'x)
       (progn
         (require 'font-lock)
        (setq c-font-lock-keywords c-font-lock-keywords-2)
         (setq font-lock-keyword-face 'bold)
         (setq font-lock-function-name-face 'underline)
         (add-hook 'c-mode-hook 'font-lock-mode)
       ))


The problem can be seen when I load the following file, for instance:

      long abc;         /* line 1 */
      long abc();       /* line 2 */
   int abc;             /* line 3 */
   int abc();           /* line 4 */
   long abc()           /* line 5 */
   {                    /* line 6 */
      int abc;          /* line 7 */
      abc(something);   /* line 8 */
   }                    /* line 9 */
   ^ column 0


It gets underlined like this:

      long abc;         /* line 1 */
           ~~~
      long abc();       /* line 2 */
   int abc;             /* line 3 */
       ~~~
   int abc();           /* line 4 */
       ~~~
   long abc()           /* line 5 */
        ~~~
   {                    /* line 6 */
      int abc;          /* line 7 */
          ~~~
      abc(something);   /* line 8 */
   }                    /* line 9 */


In lines 1, 3, and 7, abc should not be underlined, but it is.  In line 2,
abc should be underlined but it is not.  In line 8, shouldn't abc be
underlined?  At any rate, it's not.

thanks,
tw
Technical Details
Message-ID: <199408080151.VAA02392@sparcserver.mc.ab.com>
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!sun.cais.com!io.org!uunet.ca!uunet.ca!spool.mu.edu!howland.reston.ans.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!mc.ab.COM!werner

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,fe4b3d6997db1d93,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1994-08-07 23:26:05 PST
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!sun.cais.com!io.org!uunet.ca!uunet.ca!spool.mu.edu!howland.reston.ans.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!mc.ab.COM!werner
From: werner@mc.ab.COM (tim werner)
Newsgroups: gnu.emacs.bug
Subject: function-name face works wrong in font-lock mode
Date: 8 Aug 1994 01:03:48 -0400
Organization: GNUs Not Usenet
Lines: 56
Sender: daemon@cis.ohio-state.edu
Approved: bug-gnu-emacs@prep.ai.mit.edu
Distribution: gnu
Message-ID: <199408080151.VAA02392@sparcserver.mc.ab.com>