From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#22256: 25.0.50; multiline font-lock rules broken in C mode Date: Sat, 9 Jan 2016 12:19:08 +0000 Message-ID: <20160109121907.GA4598@acm.fritz.box> References: <20151229210611.64245.qmail@mail.muc.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1452341853 5938 80.91.229.3 (9 Jan 2016 12:17:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 9 Jan 2016 12:17:33 +0000 (UTC) Cc: 22256@debbugs.gnu.org To: Anders Lindgren Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jan 09 13:17:22 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aHsSP-00024g-Gb for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Jan 2016 13:17:21 +0100 Original-Received: from localhost ([::1]:40286 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHsSO-00004x-3o for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Jan 2016 07:17:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49970) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHsSF-0008Uk-CP for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2016 07:17:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aHsS7-0005IC-1S for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2016 07:17:11 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55426) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHsS6-0005Hx-OK; Sat, 09 Jan 2016 07:17:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aHsS6-0004Mi-DU; Sat, 09 Jan 2016 07:17:02 -0500 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: Sat, 09 Jan 2016 12:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22256 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 22256-submit@debbugs.gnu.org id=B22256.145234181216761 (code B ref 22256); Sat, 09 Jan 2016 12:17:02 +0000 Original-Received: (at 22256) by debbugs.gnu.org; 9 Jan 2016 12:16:52 +0000 Original-Received: from localhost ([127.0.0.1]:43646 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aHsRw-0004MH-Gm for submit@debbugs.gnu.org; Sat, 09 Jan 2016 07:16:52 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:28861) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aHsRv-0004M9-Dt for 22256@debbugs.gnu.org; Sat, 09 Jan 2016 07:16:51 -0500 Original-Received: (qmail 92059 invoked by uid 3782); 9 Jan 2016 12:16:50 -0000 Original-Received: from acm.muc.de (p5B146176.dip0.t-ipconnect.de [91.20.97.118]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 09 Jan 2016 13:16:47 +0100 Original-Received: (qmail 4603 invoked by uid 1000); 9 Jan 2016 12:19:08 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) 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: 208.118.235.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:111417 Archived-At: Hello, Anders. Thanks for doing all the donkey work. On Fri, Jan 08, 2016 at 10:34:09PM +0100, Anders Lindgren wrote: > Hi Alan (and the list), > I made a "git bisect" and found the culprit: > -------- > b31d359d182eb252a11f0468a7dc1ee1eafb28e9 is the first bad commit > commit b31d359d182eb252a11f0468a7dc1ee1eafb28e9 > Author: Alan Mackenzie > Date: Sun Feb 1 21:20:35 2015 +0000 > CC Mode: Stop Font Lock forcing fontification from BOL. Fixes > debbugs#19669. > cc-mode.el (c-font-lock-init): Setq font-lock-extend-region-functions > to nil. > -------- > The reason this breaks multiline keywords is that > `font-lock-extend-region-multiline' is normally part of > `font-lock-extend-region-functions'. OK. The fix is then fairly obvious: to remove the one function from `font-lock-extend-region-functions' which was causing the problem, leaving the other functions (in particular `font-lock-extend-region-multiline') in place. Could you try out this patch, please. It seems to work OK for me, here. diff -r a73bd5d1bd06 cc-mode.el --- a/cc-mode.el Fri Jan 08 22:25:59 2016 +0000 +++ b/cc-mode.el Sat Jan 09 12:00:10 2016 +0000 @@ -1324,12 +1324,13 @@ . c-mark-function))) ;; Prevent `font-lock-default-fontify-region' extending the region it will - ;; fontify to whole lines by removing `font-lock-extend-region-whole-lines' - ;; (and, coincidentally, `font-lock-extend-region-multiline' (which we do - ;; not need)) from `font-lock-extend-region-functions'. (Emacs only). This - ;; fixes Emacs bug #19669. + ;; fontify to whole lines by removing `font-lock-extend-region-wholelines' + ;; from `font-lock-extend-region-functions'. (Emacs only). This fixes + ;; Emacs bug #19669. (when (boundp 'font-lock-extend-region-functions) - (setq font-lock-extend-region-functions nil)) + (setq font-lock-extend-region-functions + (delq 'font-lock-extend-region-wholelines + font-lock-extend-region-functions))) (make-local-variable 'font-lock-fontify-region-function) (setq font-lock-fontify-region-function 'c-font-lock-fontify-region) > -- Anders -- Alan Mackenzie (Nuremberg, Germany).