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 #53 received at 25529 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Tom Tromey <tom <at> tromey.com>
Cc: 25529 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#25529: diagnosis and one approach to a fix
Date: Sat, 11 Feb 2017 10:41:40 -0500
> I'm making the change, but I think the fix has to look like this:

>       (when (and (looking-at js--syntax-propertize-regexp-regexp)
>                  ;; Don't touch text after END.
>                  (<= (match-end 1) end))
>         (put-text-property (match-beginning 1) (match-end 1)
>                            'syntax-table (string-to-syntax "\"/"))
>         (goto-char (match-end 0))))))

> ... the reason being, in the new regexp match #1 is just the terminating
> "/", which is the only character whose syntax we want to modify here.

Ah, I had misunderstood the code.  Then yes.


        Stefan




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.