GNU bug report logs - #16525
24.3; Weird font-lock for multi-line regexp

Previous Next

Package: emacs;

Reported by: Alex Kost <alezost <at> gmail.com>

Date: Thu, 23 Jan 2014 08:22:01 UTC

Severity: normal

Tags: notabug

Found in version 24.3

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 16525 in the body.
You can then email your comments to 16525 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#16525; Package emacs. (Thu, 23 Jan 2014 08:22:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alex Kost <alezost <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 23 Jan 2014 08:22:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Alex Kost <alezost <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3; Weird font-lock for multi-line regexp
Date: Thu, 23 Jan 2014 12:20:47 +0400
[Message part 1 (text/plain, inline)]
When I try to use a multi-line regexp in `font-lock-keywords', I have an
unusual result: some lines are highlighted and some are not (lines are
the same).

I have made a test mode, a text sample and a screenshot to show how it
looks for me when tested with "emacs -Q".

Recipe:
1. emacs -Q
2. Evaluate the contents of attached "test.el"
3. "M-x test-font-lock-mode" in a buffer with attached "sample"

[test.el (application/emacs-lisp, attachment)]
[sample (text/plain, attachment)]
[2014-01-23_115015.png (image/png, attachment)]
[Message part 5 (text/plain, inline)]
In GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 3.8.2)
 of 2013-08-07 on -mnt-storage-buildroots-staging-i686-eric
Windowing system distributor `The X.Org Foundation', version 11.0.11405000
Configured using:
 `configure '--prefix=/usr' '--sysconfdir=/etc' '--libexecdir=/usr/lib'
 '--localstatedir=/var' '--with-x-toolkit=gtk3' '--with-xft'
 'CFLAGS=-march=i686 -mtune=generic -O2 -pipe -fstack-protector
 --param=ssp-buffer-size=4'
 'LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro'
 'CPPFLAGS=-D_FORTIFY_SOURCE=2''

Important settings:
  value of $LC_COLLATE: C
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16525; Package emacs. (Thu, 23 Jan 2014 08:31:02 GMT) Full text and rfc822 format available.

Message #8 received at 16525 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Alex Kost <alezost <at> gmail.com>
Cc: 16525 <at> debbugs.gnu.org
Subject: Re: bug#16525: 24.3; Weird font-lock for multi-line regexp
Date: Thu, 23 Jan 2014 03:30:05 -0500
Alex Kost wrote:

> When I try to use a multi-line regexp in `font-lock-keywords', I have an
> unusual result: some lines are highlighted and some are not (lines are
> the same).
[...]
> (defun test-font-lock-keywords ()
>   '(("^<\\(foo\\)> \\(.+\\(?:
>  .+?\\)\\)\\(\\[.*\\]\\)$"
>      (1 'font-lock-function-name-face)
>      (2 'font-lock-comment-face)
>      (3 'font-lock-string-face))))

It's not that simple. See info node `(elisp)Font Lock Multiline'.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16525; Package emacs. (Thu, 23 Jan 2014 08:36:02 GMT) Full text and rfc822 format available.

Message #11 received at 16525 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Alex Kost <alezost <at> gmail.com>
Cc: 16525 <at> debbugs.gnu.org
Subject: Re: bug#16525: 24.3; Weird font-lock for multi-line regexp
Date: Thu, 23 Jan 2014 03:35:01 -0500
Glenn Morris wrote:

> It's not that simple. See info node `(elisp)Font Lock Multiline'.

I meant to say, info node `(elisp)Multiline Font Lock'. Anyway, this

http://www.gnu.org/software/emacs/manual/html_node/elisp/Multiline-Font-Lock.html




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16525; Package emacs. (Thu, 23 Jan 2014 10:00:02 GMT) Full text and rfc822 format available.

Message #14 received at 16525 <at> debbugs.gnu.org (full text, mbox):

From: Alex Kost <alezost <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 16525 <at> debbugs.gnu.org
Subject: Re: bug#16525: 24.3; Weird font-lock for multi-line regexp
Date: Thu, 23 Jan 2014 13:59:52 +0400
Glenn Morris (2014-01-23 12:30 +0400) wrote:

> Alex Kost wrote:
>
>> When I try to use a multi-line regexp in `font-lock-keywords', I have an
>> unusual result: some lines are highlighted and some are not (lines are
>> the same).
> [...]
>> (defun test-font-lock-keywords ()
>>   '(("^<\\(foo\\)> \\(.+\\(?:
>>  .+?\\)\\)\\(\\[.*\\]\\)$"
>>      (1 'font-lock-function-name-face)
>>      (2 'font-lock-comment-face)
>>      (3 'font-lock-string-face))))
>
> It's not that simple. See info node `(elisp)Font Lock Multiline'.

Thank you, I should have searched before posting.




bug closed, send any further explanations to 16525 <at> debbugs.gnu.org and Alex Kost <alezost <at> gmail.com> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 23 Jan 2014 16:55:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 21 Feb 2014 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 179 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.