From unknown Fri Aug 15 04:04:47 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#41284 <41284@debbugs.gnu.org> To: bug#41284 <41284@debbugs.gnu.org> Subject: Status: 26.3; cc-mode: Incorrect font locking of static functions Reply-To: bug#41284 <41284@debbugs.gnu.org> Date: Fri, 15 Aug 2025 11:04:47 +0000 retitle 41284 26.3; cc-mode: Incorrect font locking of static functions reassign 41284 emacs submitter 41284 "George O'Hara" severity 41284 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri May 15 07:38:40 2020 Received: (at submit) by debbugs.gnu.org; 15 May 2020 11:38:40 +0000 Received: from localhost ([127.0.0.1]:36063 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZYfn-0001TV-Qy for submit@debbugs.gnu.org; Fri, 15 May 2020 07:38:40 -0400 Received: from lists.gnu.org ([209.51.188.17]:48930) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZYJo-0007EF-BL for submit@debbugs.gnu.org; Fri, 15 May 2020 07:15:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56852) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZYJn-0005oc-Ha for bug-gnu-emacs@gnu.org; Fri, 15 May 2020 07:15:56 -0400 Received: from mail-io1-xd2e.google.com ([2607:f8b0:4864:20::d2e]:32812) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jZYJm-0000bw-A3 for bug-gnu-emacs@gnu.org; Fri, 15 May 2020 07:15:55 -0400 Received: by mail-io1-xd2e.google.com with SMTP id k18so2310276ion.0 for ; Fri, 15 May 2020 04:15:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=Y/Y8wjxYrRSLrolzaJOUXy0a8u90p8iHQ+U+KJdFAW0=; b=r9xVzPeoUhIT9INOC1juc4yFULsODPUSyZWNrHz95SPRiVO5UV55ECDRkm31MEUCDq CDs3cByxCwM+0oueL9+vv5FZOpg1nklUmStB5MJhJujD50uzvfiI1FW2BdMs0Wn7yY2G 1jtIFlNLN8uwjGdGtRCaoNBvAEUi0/n7frTwnsnqfANFBT9oeu+jv9CK70h0X64qhqmU 12GJ9CcICbcNBTkO9JWXbH62hHNQfCRwQx6Dl9HxclDJ6bynLvD/4pKLqk2G3FME84j4 jf7MF6g7roFzt+ggB/qNwMF1TWM2t4IoA9fQ8GlICSixjeuDMwzJto3pHnhwlyLx79Fk HuOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Y/Y8wjxYrRSLrolzaJOUXy0a8u90p8iHQ+U+KJdFAW0=; b=TS7swPjrK6Y7PKcErAL0p9jIsxWtVO98hej/Qz7IHaXBHg/sRdrgY2aMevHKS/G0mk TETNPPXL7expcvlS2dM6jc+h2IESwtCWYJGReALUPYYORF4mKxijDLt6h7OIGFsAWNVX zdZRUyLHxGOQRE3QzMzo+KtFMcLBGd/ZJ8X3lE+rd6oChPNzrBmNfCXUixxlAUFrr/Pm DEA3aceWva7lX54h6pUIJ37Okb+IrT0ERJ9kszkJej8A5gY7RLaizi+1yxS6EJthlE/J GGxCbggQ3PXVyhq/luvVmvx7xpEaQXdwDJTAThdakP0IZpOZAbL/3mEKeqXRMCnpAZHB pNkg== X-Gm-Message-State: AOAM530JLg1X1APM03pjMTFGrHAu7gtJjFNpoQrZl2KM6IBigXD9+vl8 nAVZE3nSRYTUa4zIJdUSvNgTHjcC9bqs6SS+nuTqixE+ X-Google-Smtp-Source: ABdhPJx1uXJvGqmXkUC28ZBBFebuG/s/o0AD2D/LPOCiX2ofgGNLsstqTZZEBGStlHwaV9csHsboEvhtW8/4NX4TpXU= X-Received: by 2002:a02:7a12:: with SMTP id a18mr2728761jac.49.1589541353033; Fri, 15 May 2020 04:15:53 -0700 (PDT) MIME-Version: 1.0 From: "George O'Hara" Date: Fri, 15 May 2020 12:15:42 +0100 Message-ID: Subject: 26.3; cc-mode: Incorrect font locking of static functions To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="000000000000b4143405a5adef6a" Received-SPF: pass client-ip=2607:f8b0:4864:20::d2e; envelope-from=georgeohara92@gmail.com; helo=mail-io1-xd2e.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 15 May 2020 07:38:37 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) --000000000000b4143405a5adef6a Content-Type: text/plain; charset="UTF-8" Hi, >From 'emacs -Q', C-x C-f and create a buffer called 'test.c'. In this buffer, type: static int some_function(); int static another_function(); some_function is not highlighted, while another_function is. I would expect both to be highlighted. Note that this also happens with C++. In GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2020-05-13 built on gohara-t450s Windowing system distributor 'The X.Org Foundation', version 11.0.12004000 System Description: Linux Mint 19.3 Tricia Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Making completion list... [2 times] Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM THREADS LCMS2 Important settings: value of $LANG: en_GB.UTF-8 locale-coding-system: utf-8-unix Major mode: Fundamental Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib dired dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils elec-pair time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 97752 8020) (symbols 48 20379 1) (miscs 40 84 118) (strings 32 28409 1537) (string-bytes 1 746781) (vectors 16 14596) (vector-slots 8 505938 8384) (floats 8 50 68) (intervals 56 246 4) (buffers 992 13)) --000000000000b4143405a5adef6a Content-Type: text/html; charset="UTF-8"
Hi,

>From 'emacs -Q', C-x C-f and create a buffer called 'test.c'.
In this buffer, type:

static int some_function();
int static another_function();

some_function is not highlighted, while another_function is.
I would expect both to be highlighted.
Note that this also happens with C++.


In GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
of 2020-05-13 built on gohara-t450s
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Linux Mint 19.3 Tricia

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list... [2 times]

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB
NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM THREADS LCMS2

Important settings:
value of $LANG: en_GB.UTF-8
locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
tooltip-mode: t
global-eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
buffer-read-only: t
line-number-mode: t
transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv
bytecomp byte-compile cconv cl-loaddefs cl-lib dired dired-loaddefs
format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg
epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils elec-pair time-date
mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode elisp-mode lisp-mode prog-mode register page menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 97752 8020)
(symbols 48 20379 1)
(miscs 40 84 118)
(strings 32 28409 1537)
(string-bytes 1 746781)
(vectors 16 14596)
(vector-slots 8 505938 8384)
(floats 8 50 68)
(intervals 56 246 4)
(buffers 992 13))
--000000000000b4143405a5adef6a-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 15 07:57:23 2020 Received: (at 41284) by debbugs.gnu.org; 15 May 2020 11:57:23 +0000 Received: from localhost ([127.0.0.1]:36117 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZYxu-0001wj-Tz for submit@debbugs.gnu.org; Fri, 15 May 2020 07:57:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56476) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZYxt-0001wV-HL for 41284@debbugs.gnu.org; Fri, 15 May 2020 07:57:21 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37940) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZYxo-0004ii-7E; Fri, 15 May 2020 07:57:16 -0400 Received: from [176.228.60.248] (port=3911 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jZYxn-0002rn-6k; Fri, 15 May 2020 07:57:15 -0400 Date: Fri, 15 May 2020 14:57:03 +0300 Message-Id: <83v9kx1kds.fsf@gnu.org> From: Eli Zaretskii To: "George O'Hara" In-Reply-To: (georgeohara92@gmail.com) Subject: Re: bug#41284: 26.3; cc-mode: Incorrect font locking of static functions References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41284 Cc: 41284@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: "George O'Hara" > Date: Fri, 15 May 2020 12:15:42 +0100 > > >From 'emacs -Q', C-x C-f and create a buffer called 'test.c'. > In this buffer, type: > > static int some_function(); > int static another_function(); > > some_function is not highlighted, while another_function is. You mean, the other way around, no? From debbugs-submit-bounces@debbugs.gnu.org Fri May 15 08:03:59 2020 Received: (at 41284) by debbugs.gnu.org; 15 May 2020 12:03:59 +0000 Received: from localhost ([127.0.0.1]:36125 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZZ4I-00027T-Pv for submit@debbugs.gnu.org; Fri, 15 May 2020 08:03:59 -0400 Received: from mail-io1-f45.google.com ([209.85.166.45]:44587) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZZ4F-00027F-U7 for 41284@debbugs.gnu.org; Fri, 15 May 2020 08:03:56 -0400 Received: by mail-io1-f45.google.com with SMTP id f4so2346542iov.11 for <41284@debbugs.gnu.org>; Fri, 15 May 2020 05:03:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yqr3MBAHIuTJjcvRWCPLj2YMjwpzvpt5cZuN3xMruRw=; b=oW+b76TPyr00rgm3ARP0e5mNnQ3F8m7hZ1Q2YoFrSI7xcyW4bEQBk0nG170D0uOhPy 9A5Dk/ftx6WWMTtD6tjAhyTgeDaFGRTgHdkFDJq3/4kLQ554bb5FNIOyDnqkAYEAD5qg PkrIi/7OnSuvkYSa6xIh/40SgfNYR+6uN3DSSSkkV8VcSxDWLFuU+idpce2+GrGpZZTM AVnL7fvuvL9N/6WIJiyzfBblbEk+p3TAOBuafO9I/wxsYmOUpoT5e9h/6APRjgDQ4Fe7 LNNowFQ8kWp62ieiPswn7K21zNqMQwRr1KlK7hLf94cmA2eU5lgUN5zv0NtDmwkpJaWO lAxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yqr3MBAHIuTJjcvRWCPLj2YMjwpzvpt5cZuN3xMruRw=; b=AyQEjsmZsDVXgrpqLdZNBhR188aiA1D1DjsIcYNVAXIrWlP3b1VqGSjvv2aBx3OSXZ UuQK14gu62x8QgqW9Mh6V1fPwq2OTXJN+ApxV7cMcnY0NtPwNVxpQ1zvnA4o/7sTv3oi 7Y+Ps2F7legELms+jEUmvfAG3r6LfuCUWH+0QTp5bCyRwbL9cFggKQAv0JQfazj1C02l GOS2eb4QiG5MXLO95I98tz5+4cl0mUcGdV6zdC+o5xhdQtbZo5ULQ5CpWpvP7rg1phLc 1U6UJpfoacZtNhlFzQZRttd3gIwacqf7LsW7CmutWkJEsmTWhyaFrKI8dLrEOENzprzQ t95Q== X-Gm-Message-State: AOAM5337g+1fO9Yv+Vqy9+AUA6lHXRjbrMaIfpfuMtcrWT4JBuu3Kbfk 9ACyOS1p0lj6b/gvQ1FqvpVDFSOQlB/HA6TVivc= X-Google-Smtp-Source: ABdhPJydF4VcHUnR4SQYhuFfrb+93ZHnUKwfdYzq7SKSi5Fv5m7Ij+DSF+NhWj2r67rvBMvJa3A56JpjNBf3DkOzWHM= X-Received: by 2002:a6b:b2c7:: with SMTP id b190mr2568529iof.121.1589544230146; Fri, 15 May 2020 05:03:50 -0700 (PDT) MIME-Version: 1.0 References: <83v9kx1kds.fsf@gnu.org> In-Reply-To: <83v9kx1kds.fsf@gnu.org> From: "George O'Hara" Date: Fri, 15 May 2020 13:03:39 +0100 Message-ID: Subject: Re: bug#41284: 26.3; cc-mode: Incorrect font locking of static functions To: Eli Zaretskii Content-Type: multipart/alternative; boundary="0000000000003156dd05a5ae9b7b" X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 41284 Cc: 41284@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --0000000000003156dd05a5ae9b7b Content-Type: text/plain; charset="UTF-8" Hi Eli! Yes, I do mean the other way round. I made a post on the Emacs SE with images last night, which may be useful to link here. https://emacs.stackexchange.com/questions/58509/static-function-highlighting-locking-in-c?noredirect=1#comment91178_58509 As an aside, I accidentally posted this bug twice. Is there a way I can close the other issue? Kind regards On Fri, 15 May 2020 at 12:57, Eli Zaretskii wrote: > > From: "George O'Hara" > > Date: Fri, 15 May 2020 12:15:42 +0100 > > > > >From 'emacs -Q', C-x C-f and create a buffer called 'test.c'. > > In this buffer, type: > > > > static int some_function(); > > int static another_function(); > > > > some_function is not highlighted, while another_function is. > > You mean, the other way around, no? > --0000000000003156dd05a5ae9b7b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Eli!

Yes, I do mean the o= ther way round.
I made a post on the Emacs SE with images last ni= ght, which may be useful to link here.

As an aside, I accidentally posted th= is bug twice. Is there a way I can close the other issue?
Kind regards

On Fri, 15 May 2020 at 12:57, Eli Zaretskii &= lt;eliz@gnu.org> wrote:
> From: "George O= 9;Hara" <georgeohara92@gmail.com>
> Date: Fri, 15 May 2020 12:15:42 +0100
>
> >From 'emacs -Q', C-x C-f and create a buffer called 't= est.c'.
> In this buffer, type:
>
> static int some_function();
> int static another_function();
>
> some_function is not highlighted, while another_function is.

You mean, the other way around, no?
--0000000000003156dd05a5ae9b7b-- From debbugs-submit-bounces@debbugs.gnu.org Sun May 17 12:33:45 2020 Received: (at control) by debbugs.gnu.org; 17 May 2020 16:33:45 +0000 Received: from localhost ([127.0.0.1]:44452 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaMET-0006gu-7L for submit@debbugs.gnu.org; Sun, 17 May 2020 12:33:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47652) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaMES-0006gf-91 for control@debbugs.gnu.org; Sun, 17 May 2020 12:33:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33804) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaMEM-0001Op-W0 for control@debbugs.gnu.org; Sun, 17 May 2020 12:33:39 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1jaMEM-0003KW-DM for control@debbugs.gnu.org; Sun, 17 May 2020 12:33:38 -0400 Subject: control message for bug 41284 To: X-Mailer: mail (GNU Mailutils 2.99.98) Message-Id: From: Glenn Morris Date: Sun, 17 May 2020 12:33:38 -0400 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) merge 41283 41284 From debbugs-submit-bounces@debbugs.gnu.org Sun May 17 15:26:42 2020 Received: (at 41284) by debbugs.gnu.org; 17 May 2020 19:26:42 +0000 Received: from localhost ([127.0.0.1]:44788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaOvq-0001pT-9v for submit@debbugs.gnu.org; Sun, 17 May 2020 15:26:42 -0400 Received: from colin.muc.de ([193.149.48.1]:65253 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1jaOvo-0001pK-QO for 41284@debbugs.gnu.org; Sun, 17 May 2020 15:26:41 -0400 Received: (qmail 18074 invoked by uid 3782); 17 May 2020 19:26:39 -0000 Received: from acm.muc.de (p4FE15467.dip0.t-ipconnect.de [79.225.84.103]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Sun, 17 May 2020 21:26:38 +0200 Received: (qmail 11860 invoked by uid 1000); 17 May 2020 19:26:38 -0000 Date: Sun, 17 May 2020 19:26:38 +0000 To: George O'Hara Subject: Re: bug#41284: 26.3; cc-mode: Incorrect font locking of static functions Message-ID: <20200517192638.GA12648@ACM> References: <83v9kx1kds.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 41284 Cc: Eli Zaretskii , 41284@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, George. On Fri, May 15, 2020 at 13:03:39 +0100, George O'Hara wrote: > Hi Eli! > Yes, I do mean the other way round. > I made a post on the Emacs SE with images last night, which may be useful > to link here. > https://emacs.stackexchange.com/questions/58509/static-function-highlighting-locking-in-c?noredirect=1#comment91178_58509 Could you please try out the following patch. The file cc-langs.el is in directory .../emacs/lisp/progmodes. Because the change is in a macro, you will need to rebuild all of cc-*.el to get a clean build. (If you want any help with the patching or byte compiling, feel free to send me private email.) The patch increases considerably the number of keywords which can come after the "int", when previously they had to come before it. Please let us all know whether the patch actually fixes the bug satisfactorally. Thanks! diff -r de83a122cf12 cc-langs.el --- a/cc-langs.el Fri May 15 19:04:24 2020 +0000 +++ b/cc-langs.el Sun May 17 19:12:39 2020 +0000 @@ -3402,8 +3402,14 @@ The end of the first submatch is taken as the end of the operator. Identifier syntax is in effect when this is matched (see `c-identifier-syntax-table')." - t (if (c-lang-const c-type-modifier-kwds) - (concat (regexp-opt (c-lang-const c-type-modifier-kwds) t) "\\>") + t (if (or (c-lang-const c-type-modifier-kwds) (c-lang-const c-modifier-kwds)) + (concat + (regexp-opt (c--delete-duplicates + (append (c-lang-const c-type-modifier-kwds) + (c-lang-const c-modifier-kwds)) + :test 'string-equal) + t) + "\\>") ;; Default to a regexp that never matches. "\\`a\\`") ;; Check that there's no "=" afterwards to avoid matching tokens > As an aside, I accidentally posted this bug twice. Is there a way I can > close the other issue? > Kind regards > On Fri, 15 May 2020 at 12:57, Eli Zaretskii wrote: > > > From: "George O'Hara" > > > Date: Fri, 15 May 2020 12:15:42 +0100 > > > >From 'emacs -Q', C-x C-f and create a buffer called 'test.c'. > > > In this buffer, type: > > > static int some_function(); > > > int static another_function(); > > > some_function is not highlighted, while another_function is. > > You mean, the other way around, no? -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Mon May 18 14:38:16 2020 Received: (at 41284-done) by debbugs.gnu.org; 18 May 2020 18:38:16 +0000 Received: from localhost ([127.0.0.1]:48252 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jakeV-0005jr-QV for submit@debbugs.gnu.org; Mon, 18 May 2020 14:38:16 -0400 Received: from colin.muc.de ([193.149.48.1]:55403 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1jakeT-0005ji-Nk for 41284-done@debbugs.gnu.org; Mon, 18 May 2020 14:38:14 -0400 Received: (qmail 9412 invoked by uid 3782); 18 May 2020 18:38:11 -0000 Received: from acm.muc.de (p4fe15caf.dip0.t-ipconnect.de [79.225.92.175]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Mon, 18 May 2020 20:38:10 +0200 Received: (qmail 14279 invoked by uid 1000); 18 May 2020 18:38:11 -0000 Date: Mon, 18 May 2020 18:38:11 +0000 To: George O'Hara Subject: Re: bug#41284: 26.3; cc-mode: Incorrect font locking of static functions Message-ID: <20200518183811.GA14087@ACM> References: <83v9kx1kds.fsf@gnu.org> <20200517192638.GA12648@ACM> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 41284-done Cc: 41284-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, George. On Mon, May 18, 2020 at 09:52:26 +0100, George O'Hara wrote: > Hi Alan, > I can confirm that fixes it. > A huge thank you for your help! OK, that's great,thanks! I've committed the patch to the master branch at savannah, and I'm closing the bug with this post. > Kind regards > George -- Alan Mackenzie (Nuremberg, Germany). From unknown Fri Aug 15 04:04:47 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 16 Jun 2020 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator