From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#35454: 26.2.50; CC-Mode fontification fails inside macro Date: Thu, 2 May 2019 14:42:23 +0000 Message-ID: <20190502144223.GB4277__27424.2009314307$1556809536$gmane$org@ACM> References: <20190427203646.GA11087@ACM> <20190501210230.GA3999@ACM> <20190502085714.GA4277@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="111810"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: 35454@debbugs.gnu.org To: Mauro Aranda Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 02 17:05:27 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMDH5-000SrI-MN for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 May 2019 17:05:27 +0200 Original-Received: from localhost ([127.0.0.1]:52716 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMDH4-0007QD-Kp for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 May 2019 11:05:26 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47076) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMCvP-0003l7-8D for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 10:43:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMCvO-0001mA-Am for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 10:43:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33154) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hMCvO-0001m6-73; Thu, 02 May 2019 10:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hMCvO-0003Dp-08; Thu, 02 May 2019 10:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Thu, 02 May 2019 14:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35454 X-GNU-PR-Package: emacs,cc-mode Original-Received: via spool by 35454-submit@debbugs.gnu.org id=B35454.155680814812342 (code B ref 35454); Thu, 02 May 2019 14:43:01 +0000 Original-Received: (at 35454) by debbugs.gnu.org; 2 May 2019 14:42:28 +0000 Original-Received: from localhost ([127.0.0.1]:46698 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hMCuq-0003Cz-6O for submit@debbugs.gnu.org; Thu, 02 May 2019 10:42:28 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:60299 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1hMCuo-0003Cr-VQ for 35454@debbugs.gnu.org; Thu, 02 May 2019 10:42:27 -0400 Original-Received: (qmail 65177 invoked by uid 3782); 2 May 2019 14:42:25 -0000 Original-Received: from acm.muc.de (p4FE15E7B.dip0.t-ipconnect.de [79.225.94.123]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 02 May 2019 16:42:23 +0200 Original-Received: (qmail 7047 invoked by uid 1000); 2 May 2019 14:42:23 -0000 Content-Disposition: inline In-Reply-To: <20190502085714.GA4277@ACM> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:158638 Archived-At: Hello again, Mauro. On Thu, May 02, 2019 at 08:57:14 +0000, Alan Mackenzie wrote: > On Wed, May 01, 2019 at 19:31:48 -0300, Mauro Aranda wrote: > > Alan Mackenzie writes: > > I've applied the patch and tried the recipe I provided, and it works fine. > > However, when I visit editfns.c and search for EXTRA_CONTEXT_FIELDS, > > like I said in my report, I see the following problem with this variables: > > struct buffer *buffer_a; > > struct buffer *buffer_b; > > unsigned char *deletions; > > unsigned char *insertions; > > All but deletions have face font-lock-variable-name-face. [ .... ] > The problem with "deletions" seems to be triggered by the 2-line comment > in the macro not having a backslash escaping the \n. In nearly 30 years > hacking C, I've never seen this before, and didn't even know it was > valid syntax. However, this means at least four very commonly used > functions (c-beginning-of-macro, c-end-of-macro, c-forward-sws, and > c-backward-sws) are going to have to be amended to deal with it, and > this is inevitably going to make CC Mode slower. :-( I've just committed a fix to multiline comments in macros not having escaped newlines. This seems to solve the problem with the variable "deletions". That should be half the battle won. As usual, please feel free to test it for me. In the end, it didn't make CC Mode more than around 0.5% slower. I haven't yet tried combining yesterday's patch with the fix I've just committed, but if we're lucky, the two together might solve the entire bug. [ .... ] > > Best regards, > > Mauro. -- Alan Mackenzie (Nuremberg, Germany).