From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 03 21:08:43 2020 Received: (at submit) by debbugs.gnu.org; 4 Apr 2020 01:08:43 +0000 Received: from localhost ([127.0.0.1]:43353 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jKXIg-0008Nd-Sj for submit@debbugs.gnu.org; Fri, 03 Apr 2020 21:08:43 -0400 Received: from lists.gnu.org ([209.51.188.17]:37636) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jKXIf-0008NL-L1 for submit@debbugs.gnu.org; Fri, 03 Apr 2020 21:08:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52130) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jKXId-00084L-AG for bug-gnu-emacs@gnu.org; Fri, 03 Apr 2020 21:08:40 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jKXIc-0008EU-4Q for bug-gnu-emacs@gnu.org; Fri, 03 Apr 2020 21:08:39 -0400 Received: from mxout5.interscholz.de ([85.236.196.72]:51558) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jKXIb-0008Dz-Um for bug-gnu-emacs@gnu.org; Fri, 03 Apr 2020 21:08:38 -0400 Received: from localhost (mxout5 [127.0.0.1]) by mxout5.interscholz.de (Postfix) with ESMTP id CEFA221154 for ; Sat, 4 Apr 2020 03:08:34 +0200 (CEST) X-Virus-Scanned: interscholz amavisd-new at mxout5.interscholz.de Received: from server.web01.interscholz.net (server.web01.interscholz.net [85.236.196.138]) by mxout5.interscholz.de (Postfix) with ESMTP id 3A40D20DE7 for ; Sat, 4 Apr 2020 03:08:31 +0200 (CEST) Received: from pointsman2 (p5B317438.dip0.t-ipconnect.de [91.49.116.56]) by server.web01.interscholz.net (Postfix) with ESMTPSA id C2ABA340342; Sat, 4 Apr 2020 03:08:30 +0200 (CEST) From: Rolf Ade To: bug-gnu-emacs@gnu.org Subject: 26.2; (And 27.0.90) Inconsistent fontifying in c-mode Date: Sat, 04 Apr 2020 03:08:30 +0200 Message-ID: <87369k9hwx.fsf@pointsman.de> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 85.236.196.72 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: submit 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.7 (-) Recipt: emacs -Q Insert: /* 11 */ EXTERN int XML_GetCurrentByteCount(XML_Parser parser); /* 12 */ EXTERN enum XML_Status XML_SetBase(XML_Parser parser, const XML_Char *base); /* 13 */ EXTERN const XML_Char * XML_GetBase(XML_Parser parser); /* 14 */ EXTERN int XML_GetSpecifiedAttributeCount(XML_Parser parser); /* 15 */ and M-x c-mode. The font-look seems randomly. Some EXTERN colered, some not, some function names black, some blue. The whole (small) file is here http://tdom.org/index.html/raw/generic/tdomDecls.h?name=cccb9227. With this syntactically correct file (at least gcc and clang consume it without complain) there is similiar font-lock flicker around the lines commented with 12, 13, 14. I report this (and see it) on my working-place emacs-26.2 but have verified, that a freshly build emacs-27.0.90 shows the same behaviour. From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 04 05:09:22 2020 Received: (at 40421) by debbugs.gnu.org; 4 Apr 2020 09:09:22 +0000 Received: from localhost ([127.0.0.1]:43439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jKenq-00031t-KW for submit@debbugs.gnu.org; Sat, 04 Apr 2020 05:09:22 -0400 Received: from colin.muc.de ([193.149.48.1]:29575 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1jKeno-00031i-Ma for 40421@debbugs.gnu.org; Sat, 04 Apr 2020 05:09:21 -0400 Received: (qmail 52049 invoked by uid 3782); 4 Apr 2020 09:09:19 -0000 Date: 4 Apr 2020 09:09:19 -0000 Message-ID: <20200404090919.52048.qmail@mail.muc.de> From: Alan Mackenzie To: Rolf Ade Subject: Re: bug#40421: 26.2; (And 27.0.90) Inconsistent fontifying in c-mode Organization: muc.de e.V. In-Reply-To: X-Newsgroups: gnu.emacs.bug User-Agent: tin/2.4.3-20181224 ("Glen Mhor") (UNIX) (FreeBSD/11.3-RELEASE-p3 (amd64)) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 40421 Cc: 40421@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, Rolf. In article you wrote: > Recipt: > emacs -Q > Insert: > /* 11 */ > EXTERN int XML_GetCurrentByteCount(XML_Parser parser); > /* 12 */ > EXTERN enum XML_Status XML_SetBase(XML_Parser parser, const XML_Char *base); > /* 13 */ > EXTERN const XML_Char * XML_GetBase(XML_Parser parser); > /* 14 */ > EXTERN int XML_GetSpecifiedAttributeCount(XML_Parser parser); > /* 15 */ > and M-x c-mode. The font-look seems randomly. Some EXTERN colered, some > not, some function names black, some blue. Yes. The problem here is that these declarations aren't syntactically correct C. To C Mode, "EXTERN" just looks like an ordinary identifier, not a macro which (presumably) expands to "extern". I would recommend you to use CC Mode's "noise macro" facility here. (See the CC Mode manual.) With this, you would tell CC Mode that "EXTERN" just "expands to nothing", and thus won't interfere with the syntactic analysis. One way to do this is to set c-noise-macro-names in a hook function, probably c-mode-common-hook. Another way (if you don't have many source files) would be to set that variable in a file local variables section (see the Emacs manual) - for example, put the following at the end of your C file: /* Local Variables: */ /* c-noise-macro-names: ("EXTERN") */ /* END: */ . Then restart C Mode with M-x c-mode. The fontification should now look OK. > The whole (small) file is here > http://tdom.org/index.html/raw/generic/tdomDecls.h?name=cccb9227. With > this syntactically correct file (at least gcc and clang consume it > without complain) there is similiar font-lock flicker around the lines > commented with 12, 13, 14. Thanks for taking the trouble to reduce the problem to a minimal test case. That's appreciated. > I report this (and see it) on my working-place emacs-26.2 but have > verified, that a freshly build emacs-27.0.90 shows the same behaviour. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 09 20:50:24 2020 Received: (at 40421) by debbugs.gnu.org; 10 Apr 2020 00:50:24 +0000 Received: from localhost ([127.0.0.1]:54668 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jMhsG-0000kF-Ip for submit@debbugs.gnu.org; Thu, 09 Apr 2020 20:50:24 -0400 Received: from mxout5.interscholz.de ([85.236.196.72]:58974) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jMhsD-0000jz-Ts for 40421@debbugs.gnu.org; Thu, 09 Apr 2020 20:50:22 -0400 Received: from localhost (mxout5 [127.0.0.1]) by mxout5.interscholz.de (Postfix) with ESMTP id 5063521338; Fri, 10 Apr 2020 02:50:15 +0200 (CEST) X-Virus-Scanned: interscholz amavisd-new at mxout5.interscholz.de Received: from server.web01.interscholz.net (server.web01.interscholz.net [85.236.196.138]) by mxout5.interscholz.de (Postfix) with ESMTP id E411420B72; Fri, 10 Apr 2020 02:50:12 +0200 (CEST) Received: from pointsman2 (p5B317438.dip0.t-ipconnect.de [91.49.116.56]) by server.web01.interscholz.net (Postfix) with ESMTPSA id 74356F0001; Fri, 10 Apr 2020 02:50:12 +0200 (CEST) From: Rolf Ade To: Alan Mackenzie Subject: Re: bug#40421: 26.2; (And 27.0.90) Inconsistent fontifying in c-mode References: <87369k9hwx.fsf@pointsman.de> <20200404090919.52048.qmail@mail.muc.de> Date: Fri, 10 Apr 2020 02:50:12 +0200 In-Reply-To: <20200404090919.52048.qmail@mail.muc.de> (Alan Mackenzie's message of "4 Apr 2020 09:09:19 -0000") Message-ID: <87wo6o88qj.fsf@pointsman.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 40421 Cc: 40421@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.7 (-) Hello Alan, Alan Mackenzie writes: > In article you wrote: > >> Recipt: > >> emacs -Q > >> Insert: > >> /* 11 */ >> EXTERN int XML_GetCurrentByteCount(XML_Parser parser); >> /* 12 */ >> EXTERN enum XML_Status XML_SetBase(XML_Parser parser, const XML_Char *base); >> /* 13 */ >> EXTERN const XML_Char * XML_GetBase(XML_Parser parser); >> /* 14 */ >> EXTERN int XML_GetSpecifiedAttributeCount(XML_Parser parser); >> /* 15 */ > >> and M-x c-mode. The font-look seems randomly. Some EXTERN colered, some >> not, some function names black, some blue. > > Yes. The problem here is that these declarations aren't syntactically > correct C. To C Mode, "EXTERN" just looks like an ordinary identifier, > not a macro which (presumably) expands to "extern". To that, or, depending on the build evironment, to something similar, yes. I can understand, that c-mode doesn't get this right. But part of the point was the apparent randomly switching of the fontification. Getting the colors wrong is one thing (but c-mode don't even got it wrong, for the first handful of function prototypes), but getting it wrong inconstently irritates particularly. But, yes ... > I would recommend you to use CC Mode's "noise macro" facility here. > (See the CC Mode manual.) With this, you would tell CC Mode that > "EXTERN" just "expands to nothing", and thus won't interfere with the > syntactic analysis. One way to do this is to set c-noise-macro-names in > a hook function, probably c-mode-common-hook. Another way (if you don't > have many source files) would be to set that variable in a file local > variables section (see the Emacs manual) - for example, put the > following at the end of your C file: > > /* Local Variables: */ > /* c-noise-macro-names: ("EXTERN") */ > /* END: */ > > . Then restart C Mode with M-x c-mode. The fontification should now > look OK. ... that works well, thanks. Sorry for the noise. >> The whole (small) file is here >> http://tdom.org/index.html/raw/generic/tdomDecls.h?name=cccb9227. With >> this syntactically correct file (at least gcc and clang consume it >> without complain) there is similiar font-lock flicker around the lines >> commented with 12, 13, 14. > > Thanks for taking the trouble to reduce the problem to a minimal test > case. That's appreciated. > >> I report this (and see it) on my working-place emacs-26.2 but have >> verified, that a freshly build emacs-27.0.90 shows the same behaviour. From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 13 09:57:26 2020 Received: (at control) by debbugs.gnu.org; 13 Apr 2020 13:57:26 +0000 Received: from localhost ([127.0.0.1]:60428 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNzaX-00017J-U8 for submit@debbugs.gnu.org; Mon, 13 Apr 2020 09:57:26 -0400 Received: from mail-qk1-f182.google.com ([209.85.222.182]:46708) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNzaW-000176-Em for control@debbugs.gnu.org; Mon, 13 Apr 2020 09:57:24 -0400 Received: by mail-qk1-f182.google.com with SMTP id g74so9379571qke.13 for ; Mon, 13 Apr 2020 06:57:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=bbOoTOjgz1ISJ2AHhHF8o2yF2R8eaY0gYjD1c/jODII=; b=Whc5+lK/zcmKGfyLnl7JShkyHzTM9XDa40M59m4ZFSc5j9QU9LsV/xdQF7sSbqWd3N CDYMph1OBmCv+Mwh1NrEi6CtJN5L1NUZB3QEBdcf5eKlO+yxvHy7qiM7mP7ETenyGeZw +DCujXtPKDtMIj+lTgY2V/eyPq9IzndcQncAlif6lrjI+6zBJenGRb2LzoDXO9Wg4/3A THULoSKDnIFD6Ua69lNZiw14IUvvvTQgWpBJMZgoBE+fKzks2W1T0Cs5xx1zcCTat3em AjkC5/0npeTDeoQaGrSZQqv4Qguc7WzpdPsssYunTn8GSeAbQlcoOo0qL4JZ3k2kxVtx DgBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=bbOoTOjgz1ISJ2AHhHF8o2yF2R8eaY0gYjD1c/jODII=; b=Mh8wYLO1kftuGhNcFUT5gTUo6sWypvN2lNELOJh1CZQUagpxdEnzKLmbXpgLL4sYBl vWgfA1+li60cRsMVrNsP8NaP1wHjnO3UQiU4fjt5uL7q2Dc8tpjOqE5PGP/4c10TSq0Q 5/gmIfPRUKIQ5wJs9jl2PBqJmTK6TOKnRolw/uFGb9gSI+42bA5kdKC4d4uQMN31nsMP k7tRlYgQHQ7Pc1C+BssDmtEqenML+zpVGD29EuXpf1mAQH2hqyLXaxoRg6di2Wx0epne kCu7tReW2eMSCow32+1UQru8o00rE/NuPZlMa4fpcgFWZFc1VZZUamXiO7AxeGsVqLGl NxkQ== X-Gm-Message-State: AGi0PuaC7TD156VOXK0IEIuj3IpW0dW2RwfjuZPyoVzoubhfX1afNnKr QBYoZl9w0bKDibJmrpnDsJMjP6dn5JQ= X-Google-Smtp-Source: APiQypLc0VAVWA1EG1GYI/9Sx6yExUCflKiSHRiRUy8iPOqtFjHWpeSu3JoKIPFkL+P72xpUFbF2sg== X-Received: by 2002:a05:620a:16cf:: with SMTP id a15mr1734951qkn.156.1586786237308; Mon, 13 Apr 2020 06:57:17 -0700 (PDT) Received: from vhost2 (CPE001143542e1f-CMf81d0f809fa0.cpe.net.cable.rogers.com. [99.230.38.42]) by smtp.gmail.com with ESMTPSA id y21sm8251776qka.37.2020.04.13.06.57.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Apr 2020 06:57:16 -0700 (PDT) From: Noam Postavsky To: control@debbugs.gnu.org Subject: control message for bug #40421 Date: Mon, 13 Apr 2020 09:57:16 -0400 Message-ID: <85v9m3zdxf.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.8 (/) 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: -1.8 (-) tags 40421 notabug close 40421 quit From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 13 14:33:04 2020 Received: (at 40421) by debbugs.gnu.org; 13 Apr 2020 18:33:04 +0000 Received: from localhost ([127.0.0.1]:60766 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jO3tI-00043i-Fq for submit@debbugs.gnu.org; Mon, 13 Apr 2020 14:33:04 -0400 Received: from colin.muc.de ([193.149.48.1]:10121 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1jO3tF-00043H-Tp for 40421@debbugs.gnu.org; Mon, 13 Apr 2020 14:33:02 -0400 Received: (qmail 92973 invoked by uid 3782); 13 Apr 2020 18:33:00 -0000 Received: from acm.muc.de (p4FE15D33.dip0.t-ipconnect.de [79.225.93.51]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Mon, 13 Apr 2020 20:32:58 +0200 Received: (qmail 15359 invoked by uid 1000); 13 Apr 2020 18:32:57 -0000 Date: Mon, 13 Apr 2020 18:32:57 +0000 To: Rolf Ade Subject: Re: bug#40421: 26.2; (And 27.0.90) Inconsistent fontifying in c-mode Message-ID: <20200413183257.GB5898@ACM> References: <87369k9hwx.fsf@pointsman.de> <20200404090919.52048.qmail@mail.muc.de> <87wo6o88qj.fsf@pointsman.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87wo6o88qj.fsf@pointsman.de> 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: 40421 Cc: 40421@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, Rolf On Fri, Apr 10, 2020 at 02:50:12 +0200, Rolf Ade wrote: > Hello Alan, > Alan Mackenzie writes: > > In article you wrote: > >> Recipt: > >> emacs -Q > >> Insert: > >> /* 11 */ > >> EXTERN int XML_GetCurrentByteCount(XML_Parser parser); > >> /* 12 */ > >> EXTERN enum XML_Status XML_SetBase(XML_Parser parser, const XML_Char *base); > >> /* 13 */ > >> EXTERN const XML_Char * XML_GetBase(XML_Parser parser); > >> /* 14 */ > >> EXTERN int XML_GetSpecifiedAttributeCount(XML_Parser parser); > >> /* 15 */ > >> and M-x c-mode. The font-look seems randomly. Some EXTERN colered, some > >> not, some function names black, some blue. > > Yes. The problem here is that these declarations aren't syntactically > > correct C. To C Mode, "EXTERN" just looks like an ordinary identifier, > > not a macro which (presumably) expands to "extern". > To that, or, depending on the build evironment, to something similar, > yes. > I can understand, that c-mode doesn't get this right. But part of the > point was the apparent randomly switching of the fontification. Getting > the colors wrong is one thing (but c-mode don't even got it wrong, for > the first handful of function prototypes), but getting it wrong > inconstently irritates particularly. Sorry, I don't think I can offer anything constructive, here. Macro occurrences in text are difficult to handle well, since they can expand to anything at all (or nothing). Only if (?when) CC Mode starts doing deeper analysis of the code, something compiler-like, is there really any hope for anything better. > But, yes ... > > I would recommend you to use CC Mode's "noise macro" facility here. > > (See the CC Mode manual.) With this, you would tell CC Mode that > > "EXTERN" just "expands to nothing", and thus won't interfere with the > > syntactic analysis. One way to do this is to set c-noise-macro-names in > > a hook function, probably c-mode-common-hook. Another way (if you don't > > have many source files) would be to set that variable in a file local > > variables section (see the Emacs manual) - for example, put the > > following at the end of your C file: > > /* Local Variables: */ > > /* c-noise-macro-names: ("EXTERN") */ > > /* END: */ > > . Then restart C Mode with M-x c-mode. The fontification should now > > look OK. > ... that works well, thanks. Good! :-) > Sorry for the noise. Not a problem. I'll close the bug report (as notabug). Sorry I can't offer anything better. > >> The whole (small) file is here > >> http://tdom.org/index.html/raw/generic/tdomDecls.h?name=cccb9227. With > >> this syntactically correct file (at least gcc and clang consume it > >> without complain) there is similiar font-lock flicker around the lines > >> commented with 12, 13, 14. > > Thanks for taking the trouble to reduce the problem to a minimal test > > case. That's appreciated. > >> I report this (and see it) on my working-place emacs-26.2 but have > >> verified, that a freshly build emacs-27.0.90 shows the same behaviour. -- Alan Mackenzie (Nuremberg, Germany). From unknown Sat Aug 16 14:25:53 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, 12 May 2020 11:24:05 +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