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: Mon, 28 Dec 2015 11:19:30 +0100 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11438ee8009b7f0527f2a46a X-Trace: ger.gmane.org 1451298020 20655 80.91.229.3 (28 Dec 2015 10:20:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Dec 2015 10:20:20 +0000 (UTC) To: 22256@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 28 11:20:10 2015 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 1aDUuP-0005F3-Fv for geb-bug-gnu-emacs@m.gmane.org; Mon, 28 Dec 2015 11:20:09 +0100 Original-Received: from localhost ([::1]:44091 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aDUuO-0005y1-Sa for geb-bug-gnu-emacs@m.gmane.org; Mon, 28 Dec 2015 05:20:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aDUuJ-0005xd-Ri for bug-gnu-emacs@gnu.org; Mon, 28 Dec 2015 05:20:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aDUuI-0006KQ-2z for bug-gnu-emacs@gnu.org; Mon, 28 Dec 2015 05:20:03 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37730) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aDUuH-0006KK-VW for bug-gnu-emacs@gnu.org; Mon, 28 Dec 2015 05:20:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aDUuH-0000Nu-Nd for bug-gnu-emacs@gnu.org; Mon, 28 Dec 2015 05:20:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Anders Lindgren Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 28 Dec 2015 10:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 22256 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14512979861452 (code B ref -1); Mon, 28 Dec 2015 10:20:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 Dec 2015 10:19:46 +0000 Original-Received: from localhost ([127.0.0.1]:45332 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aDUu1-0000NL-Ng for submit@debbugs.gnu.org; Mon, 28 Dec 2015 05:19:46 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:54504) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aDUtz-0000N8-26 for submit@debbugs.gnu.org; Mon, 28 Dec 2015 05:19:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aDUtr-00060c-Sr for submit@debbugs.gnu.org; Mon, 28 Dec 2015 05:19:37 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:35728) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aDUtr-00060X-PD for submit@debbugs.gnu.org; Mon, 28 Dec 2015 05:19:35 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aDUtp-0005wP-NK for bug-gnu-emacs@gnu.org; Mon, 28 Dec 2015 05:19:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aDUtn-000600-H3 for bug-gnu-emacs@gnu.org; Mon, 28 Dec 2015 05:19:33 -0500 Original-Received: from mail-vk0-x229.google.com ([2607:f8b0:400c:c05::229]:34515) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aDUtn-0005zv-BC for bug-gnu-emacs@gnu.org; Mon, 28 Dec 2015 05:19:31 -0500 Original-Received: by mail-vk0-x229.google.com with SMTP id a123so18596146vkh.1 for ; Mon, 28 Dec 2015 02:19:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=CeG11GVmIm4irSHi54T+/34/MlnGlNq41BZQfIp0rO0=; b=w4p2P48tFiUMVIzE280mmGNmep7VHmXJ2+jMG62cZZ4NLbXsxsY00mgmJRYNM65HH+ krFNZxn6mzREbm4cfjkQhQLsKm3SBXZb+w2oyN+Ake+Nr3/vvRphRlplfjhsH3DOG7TM R6MCg0NXUgnuXgBbuVpLEOdH6dnxJhL7G8XkCs5CS/ppO/ePD/tqrwkzKJp5jPrsel/c pgxL+i35YnfVSDSPnYMqvCAmkMv0t18wVEE2cBaSjS4EYa16a8AXG7g6brMyqFby1w+M gYIp/a0H/HG76lIfeE6VUpqaAXcplZTTDD7t6eWh7Jljyrj712APxotZ/5jFXt+qrb+k T8yg== X-Received: by 10.31.54.134 with SMTP id d128mr31519701vka.26.1451297970623; Mon, 28 Dec 2015 02:19:30 -0800 (PST) Original-Received: by 10.31.214.131 with HTTP; Mon, 28 Dec 2015 02:19:30 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:110890 Archived-At: --001a11438ee8009b7f0527f2a46a Content-Type: text/plain; charset=UTF-8 Hi! In C and related modes, multiline font-lock rules no longer work as expected. It looks like a few lines are highlighted, but not all of them. For example: Eval the following: (defvar my-multiline-test-keywords '(("^X" ("^.+$" (progn (beginning-of-line) (point-max)) nil (0 'highlight))))) (defun my-multiline-test-add () (interactive) (font-lock-add-keywords nil my-multiline-test-keywords) (font-lock-flush)) Insert the following in a new buffer: X START OF A HIGHLIGHTED BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK Do: M-x c-mode RET M-x my-multiline-test-add RET I expect the entire buffer to be highlighted. However, only the first eight lines are highlighted. When the block is edited, different parts of the block is highlighted and unhighlighted. As a contrast, when `emacs-lisp-mode' is used, the entire block is highlighted, and editing does not change the highlighting. This worked as intended in Emacs 24.5. -- Anders Lindgren In GNU Emacs 25.0.50.60 (x86_64-apple-darwin14.5.0, NS appkit-1348.17 Version 10.10.5 (Build 14F27)) of 2015-12-28 Repository revision: e9916d8880561cc06b6cb73bafe7257b93ffbf4c Windowing system distributor 'Apple', version 10.3.1348 Configured using: 'configure --without-dbus' Configured features: ACL ZLIB TOOLKIT_SCROLL_BARS NS Important settings: value of $LC_CTYPE: UTF-8 locale-coding-system: utf-8-unix Major mode: C/l Minor modes in effect: preproc-font-lock-global-mode: t preproc-font-lock-mode: t 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 font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t abbrev-mode: t Recent messages: previous-line: Beginning of buffer [6 times] Preproc-Font-Lock mode enabled in current buffer Making completion list... [2 times] Type C-x 1 to delete the help window. Making completion list... [2 times] previous-line: Beginning of buffer [4 times] Saving file /Users/anders/emacs/src/bugs/multiline.c... Wrote /Users/anders/emacs/src/bugs/multiline.c Making completion list... [2 times] Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message dired format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils pp help-fns dabbrev character-fold misearch multi-isearch cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs cus-start cus-load preproc-font-lock easy-mmode vc-dispatcher vc-svn seq byte-opt gv bytecomp byte-compile cconv cl-extra help-mode easymenu cl-loaddefs pcase cl-lib time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel ns-win term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core 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 charscript case-table epa-hook jka-cmpr-hook help simple abbrev 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 cocoa ns multi-tty make-network-process emacs) Memory information: ((conses 16 125810 6766) (symbols 48 22477 0) (miscs 40 92 691) (strings 32 31081 19325) (string-bytes 1 1057796) (vectors 16 15058) (vector-slots 8 499686 7007) (floats 8 160 240) (intervals 56 3315 21) (buffers 976 15)) --001a11438ee8009b7f0527f2a46a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi!

In C and related modes, multiline font-lock rul= es no longer work as expected. It looks like a few lines are highlighted, b= ut not all of them.

For example:
Eval the following:
(defvar m= y-multiline-test-keywords
=C2=A0'(("^X"
=C2=A0 =C2=A0 = =C2=A0("^.+$"
=C2=A0 =C2=A0 =C2=A0 (progn (beginning-of-line)<= br>=C2=A0 =C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0(point-max))
=C2= =A0 =C2=A0 =C2=A0 nil
=C2=A0 =C2=A0 =C2=A0 (0 'highlight)))))
(defun my-multiline-test-add ()
=C2=A0 (interactive)
=C2=A0 (font-lo= ck-add-keywords nil my-multiline-test-keywords)
=C2=A0 (font-lock-flush)= )

Insert the following in a new buffer:

X START OF A HIGHLIGH= TED BLOCK
LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN = THE BLOCK
LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN = THE BLOCK
LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN = THE BLOCK
LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN = THE BLOCK
LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN = THE BLOCK
LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN = THE BLOCK
LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN = THE BLOCK
LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN = THE BLOCK
LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN = THE BLOCK
LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN = THE BLOCK
LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN = THE BLOCK
LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN = THE BLOCK
LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN = THE BLOCK
LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN = THE BLOCK
LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN = THE BLOCK
LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN = THE BLOCK
LONG LINES IN THE BLOCK LONG LINES IN THE BLOCK LONG LINES IN = THE BLOCK

Do:
M-x c-mode RET
M-x my-multiline-test-add RET
=
I expect the entire buffer to be highlighted. However, only=C2=A0the fi= rst eight lines are highlighted. When the block is edited, different parts = of the block is highlighted and unhighlighted.

As a contrast, when `= emacs-lisp-mode' is used, the entire block is highlighted, and editing = does not change the highlighting.

This worked as intended in Emacs 2= 4.5.

=C2=A0 =C2=A0 -- Anders Lindgren

In GNU Emacs 25.0.50.60= (x86_64-apple-darwin14.5.0, NS appkit-1348.17 Version 10.10.5 (Build 14F27= ))
=C2=A0of 2015-12-28
Repository revision: e9916d8880561cc06b6cb73ba= fe7257b93ffbf4c
Windowing system distributor 'Apple', version 10= .3.1348
Configured using:
=C2=A0'configure --without-dbus'
Configured features:
ACL ZLIB TOOLKIT_SCROLL_BARS NS

Importa= nt settings:
=C2=A0 value of $LC_CTYPE: UTF-8
=C2=A0 locale-coding-sy= stem: utf-8-unix

Major mode: C/l

Minor modes in effect:
= =C2=A0 preproc-font-lock-global-mode: t
=C2=A0 preproc-font-lock-mode: t=
=C2=A0 tooltip-mode: t
=C2=A0 global-eldoc-mode: t
=C2=A0 electri= c-indent-mode: t
=C2=A0 mouse-wheel-mode: t
=C2=A0 tool-bar-mode: t=C2=A0 menu-bar-mode: t
=C2=A0 file-name-shadow-mode: t
=C2=A0 glob= al-font-lock-mode: t
=C2=A0 font-lock-mode: t
=C2=A0 blink-cursor-mod= e: t
=C2=A0 auto-composition-mode: t
=C2=A0 auto-encryption-mode: t=C2=A0 auto-compression-mode: t
=C2=A0 line-number-mode: t
=C2=A0 t= ransient-mark-mode: t
=C2=A0 abbrev-mode: t

Recent messages:
p= revious-line: Beginning of buffer [6 times]
Preproc-Font-Lock mode enabl= ed in current buffer
Making completion list... [2 times]
Type C-x 1 t= o delete the help window.
Making completion list... [2 times]

pre= vious-line: Beginning of buffer [4 times]
Saving file /Users/anders/emac= s/src/bugs/multiline.c...
Wrote /Users/anders/emacs/src/bugs/multiline.c=
Making completion list... [2 times]

Load-path shadows:
None f= ound.

Features:
(shadow sort gnus-util mail-extr emacsbug message= dired format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail= -parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 = ietf-drums
mm-util mail-prsvr mail-utils pp help-fns dabbrev character-f= old
misearch multi-isearch cc-mode cc-fonts cc-guess cc-menus cc-cmdscc-styles cc-align cc-engine cc-vars cc-defs cus-start cus-load
preproc= -font-lock easy-mmode vc-dispatcher vc-svn seq byte-opt gv
bytecomp byte= -compile cconv cl-extra help-mode easymenu cl-loaddefs
pcase cl-lib time= -date mule-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp= -float-type mwheel ns-win term/common-win
tool-bar dnd fontset image reg= exp-opt fringe tabulated-list newcomment
elisp-mode lisp-mode prog-mode = register page menu-bar rfn-eshadow timer
select scroll-bar mouse jit-loc= k font-lock syntax facemenu font-core
frame cl-generic cham georgian utf= -8-lang misc-lang vietnamese tibetan
thai tai-viet lao korean japanese e= ucjp-ms cp51932 hebrew greek romanian
slovak czech european ethiopic ind= ian cyrillic chinese charscript
case-table epa-hook jka-cmpr-hook help s= imple abbrev minibuffer
cl-preloaded nadvice loaddefs button faces cus-f= ace macroexp files
text-properties overlay sha1 md5 base64 format env co= de-pages mule
custom widget hashtable-print-readable backquote cocoa ns = multi-tty
make-network-process emacs)

Memory information:
((co= nses 16 125810 6766)
=C2=A0(symbols 48 22477 0)
=C2=A0(miscs 40 92 69= 1)
=C2=A0(strings 32 31081 19325)
=C2=A0(string-bytes 1 1057796)
= =C2=A0(vectors 16 15058)
=C2=A0(vector-slots 8 499686 7007)
=C2=A0(fl= oats 8 160 240)
=C2=A0(intervals 56 3315 21)
=C2=A0(buffers 976 15))<= /div> --001a11438ee8009b7f0527f2a46a--