From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Anders Lindgren Newsgroups: gmane.emacs.bugs Subject: bug#22256: 25.0.50; multiline font-lock rules broken in C mode Date: Sat, 9 Jan 2016 14:40:24 +0100 Message-ID: References: <20151229210611.64245.qmail@mail.muc.de> <20160109121907.GA4598@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11438ee896cc750528e6d8b1 X-Trace: ger.gmane.org 1452346880 13628 80.91.229.3 (9 Jan 2016 13:41:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 9 Jan 2016 13:41:20 +0000 (UTC) Cc: 22256@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jan 09 14:41:11 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 1aHtlW-0007gf-4u for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Jan 2016 14:41:10 +0100 Original-Received: from localhost ([::1]:40672 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHtlV-0005Cr-Gj for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Jan 2016 08:41:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHtlS-0005Cl-2R for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2016 08:41:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aHtlO-0002sX-RC for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2016 08:41:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55455) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHtlO-0002rj-Md; Sat, 09 Jan 2016 08:41:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aHtlO-0007wg-D6; Sat, 09 Jan 2016 08:41:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Anders Lindgren Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Sat, 09 Jan 2016 13:41: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.145234683330499 (code B ref 22256); Sat, 09 Jan 2016 13:41:02 +0000 Original-Received: (at 22256) by debbugs.gnu.org; 9 Jan 2016 13:40:33 +0000 Original-Received: from localhost ([127.0.0.1]:43675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aHtkv-0007vq-0T for submit@debbugs.gnu.org; Sat, 09 Jan 2016 08:40:33 -0500 Original-Received: from mail-vk0-f46.google.com ([209.85.213.46]:34434) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aHtks-0007vd-Lb for 22256@debbugs.gnu.org; Sat, 09 Jan 2016 08:40:32 -0500 Original-Received: by mail-vk0-f46.google.com with SMTP id a123so174250604vkh.1 for <22256@debbugs.gnu.org>; Sat, 09 Jan 2016 05:40:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=EddWVldJq33M7YZ3Ux2mLjS+Zde3Cg1nIKhNVvKFbjo=; b=LuCGbw5zk8hqsJgWZlD3/25oDCW77ShdLlJSM5b6MZfBi/rTCW9TWheSs7SM3+fd+l IO1RC708/ztINczhb0L60bzD2bdoNx0RBcFl94IkaiQDFv0n4h/6uUinDxZTSHg0vVxb 5ifquaC7okNhuUs46q5Tl/0IDnwxLK2+3EX5PdJX4qt68Tqlw2NA2I87qjc5RHHZqThb eFt8Uewf4q+vxbSspSD/5BmhKeDU/OaZYvJoqr5vrFOAEEx1iL+Ea8OcWdWuNBQM3B63 dObAfVxZjTodYgw+TaywsUi8Mmcc7/UUI47AshxSIKvlA8mmQP/d4fRuTo1HV0v5PjO5 thGQ== X-Received: by 10.31.54.134 with SMTP id d128mr75973865vka.26.1452346824902; Sat, 09 Jan 2016 05:40:24 -0800 (PST) Original-Received: by 10.31.214.131 with HTTP; Sat, 9 Jan 2016 05:40:24 -0800 (PST) In-Reply-To: <20160109121907.GA4598@acm.fritz.box> 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:111423 Archived-At: --001a11438ee896cc750528e6d8b1 Content-Type: text/plain; charset=UTF-8 Hi! I just tested this and I can verify that this solved my multiline problem. Thanks! -- Anders On Sat, Jan 9, 2016 at 1:19 PM, Alan Mackenzie wrote: > 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). > --001a11438ee896cc750528e6d8b1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi!

I just tested this and I can verify= that this solved my multiline problem.

Thanks!

=C2=A0 =C2=A0 -- Anders


On S= at, Jan 9, 2016 at 1:19 PM, Alan Mackenzie <acm@muc.de> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex">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 <acm@muc.de>
> Date:=C2=A0 =C2=A0Sun Feb 1 21:20:35 2015 +0000

>=C2=A0 =C2=A0 =C2=A0CC Mode: Stop Font Lock forcing fontification from = BOL.=C2=A0 Fixes
> debbugs#19669.
>=C2=A0 =C2=A0 =C2=A0cc-mode.el (c-font-lock-init): Setq font-lock-exten= d-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.=C2=A0 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.=C2=A0 It seems to work OK for me, her= e.



diff -r a73bd5d1bd06 cc-mode.el
--- a/cc-mode.el=C2=A0 =C2=A0 =C2=A0 =C2=A0 Fri Jan 08 22:25:59 2016 +0000<= br> +++ b/cc-mode.el=C2=A0 =C2=A0 =C2=A0 =C2=A0 Sat Jan 09 12:00:10 2016 +0000<= br> @@ -1324,12 +1324,13 @@
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0. c-mark-function)))

=C2=A0 =C2=A0;; Prevent `font-lock-default-fontify-region' extending th= e region it will
-=C2=A0 ;; fontify to whole lines by removing `font-lock-extend-region-whol= e-lines'
-=C2=A0 ;; (and, coincidentally, `font-lock-extend-region-multiline' (w= hich we do
-=C2=A0 ;; not need)) from `font-lock-extend-region-functions'.=C2=A0 (= Emacs only).=C2=A0 This
-=C2=A0 ;; fixes Emacs bug #19669.
+=C2=A0 ;; fontify to whole lines by removing `font-lock-extend-region-whol= elines'
+=C2=A0 ;; from `font-lock-extend-region-functions'.=C2=A0 (Emacs only)= .=C2=A0 This fixes
+=C2=A0 ;; Emacs bug #19669.
=C2=A0 =C2=A0(when (boundp 'font-lock-extend-region-functions)
-=C2=A0 =C2=A0 (setq font-lock-extend-region-functions nil))
+=C2=A0 =C2=A0 (setq font-lock-extend-region-functions
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(delq 'font-lock-extend-region-whole= lines
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0font-lock-extend-re= gion-functions)))

=C2=A0 =C2=A0(make-local-variable 'font-lock-fontify-region-function) =C2=A0 =C2=A0(setq font-lock-fontify-region-function 'c-font-lock-fonti= fy-region)


>=C2=A0 =C2=A0 =C2=A0-- Anders

--
Alan Mackenzie (Nuremberg, Germany).

--001a11438ee896cc750528e6d8b1--