all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Anders Lindgren <andlind@gmail.com>
To: 22256@debbugs.gnu.org
Subject: bug#22256: 25.0.50; multiline font-lock rules broken in C mode
Date: Mon, 28 Dec 2015 11:19:30 +0100	[thread overview]
Message-ID: <CABr8ebas6J4ioEbstiRwKWJhdqZ5yzPvOD2KE1m+NfTRqMaHMw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 5158 bytes --]

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))

[-- Attachment #2: Type: text/html, Size: 5694 bytes --]

             reply	other threads:[~2015-12-28 10:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-28 10:19 Anders Lindgren [this message]
     [not found] ` <mailman.1133.1451298006.843.bug-gnu-emacs@gnu.org>
2015-12-29 21:06   ` bug#22256: 25.0.50; multiline font-lock rules broken in C mode Alan Mackenzie
2015-12-30  5:50     ` Anders Lindgren
2016-01-08 21:34       ` Anders Lindgren
2016-01-09 12:19         ` Alan Mackenzie
2016-01-09 13:40           ` Anders Lindgren
2016-01-09 15:25             ` Alan Mackenzie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABr8ebas6J4ioEbstiRwKWJhdqZ5yzPvOD2KE1m+NfTRqMaHMw@mail.gmail.com \
    --to=andlind@gmail.com \
    --cc=22256@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.