From: Anders Lindgren <andlind@gmail.com>
To: Alan Mackenzie <acm@muc.de>
Cc: 22256@debbugs.gnu.org
Subject: bug#22256: 25.0.50; multiline font-lock rules broken in C mode
Date: Sat, 9 Jan 2016 14:40:24 +0100 [thread overview]
Message-ID: <CABr8ebagag_9Z08=obg8mOrtgbpNGS7cu7Ww7Ro0AEc7cMpLGw@mail.gmail.com> (raw)
In-Reply-To: <20160109121907.GA4598@acm.fritz.box>
[-- Attachment #1: Type: text/plain, Size: 2499 bytes --]
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 <acm@muc.de> 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 <acm@muc.de>
> > 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).
>
[-- Attachment #2: Type: text/html, Size: 3363 bytes --]
next prev parent reply other threads:[~2016-01-09 13:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-28 10:19 bug#22256: 25.0.50; multiline font-lock rules broken in C mode Anders Lindgren
[not found] ` <mailman.1133.1451298006.843.bug-gnu-emacs@gnu.org>
2015-12-29 21:06 ` 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 [this message]
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CABr8ebagag_9Z08=obg8mOrtgbpNGS7cu7Ww7Ro0AEc7cMpLGw@mail.gmail.com' \
--to=andlind@gmail.com \
--cc=22256@debbugs.gnu.org \
--cc=acm@muc.de \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).