GNU bug report logs - #25529
25.1.90; js-mode: Regexp literal with unbalanced brackets breaks font-lock

Previous Next

Package: emacs;

Reported by: Mikhail Gusarov <mikhail <at> hola.org>

Date: Wed, 25 Jan 2017 11:15:02 UTC

Severity: minor

Found in version 25.1.90

Done: Tom Tromey <tom <at> tromey.com>

Bug is archived. No further changes may be made.

Full log


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

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Tom Tromey <tom <at> tromey.com>
Cc: 25529 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Subject: Re: bug#25529: diagnosis and one approach to a fix
Date: Tue, 7 Feb 2017 15:11:13 +0200
On 07.02.2017 15:07, Tom Tromey wrote:

> Dmitry> I'm not sure. Normally, that helps deal with multiline literals, but
> Dmitry> regexps in JavaScript are single-line. Maybe Stefan remembers.
> 
> Based on discussion in the multi-mode thread, I'm thinking perhaps it
> handles the case where the start of the regexp literal was syntax-ified
> but not the end.

That's the idea, but syntax-propertize runs 
syntax-propertize-extend-region-functions, which extends to the 
beginning of the line of the edited region.

So if we made an edit inside a line containing a regexp, START should be 
at the beginning of that line.

There could be some edge cases, though.




This bug report was last modified 8 years and 180 days ago.

Previous Next


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