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


View this message in rfc822 format

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: bug#25529: diagnosis and one approach to a fix
Date: Fri, 10 Feb 2017 23:22:23 -0500
Stefan> Removing the `end` argument is fundamentally wrong.  It's OK to play it
Stefan> fast-and-loose and ignore that argument, but the function *should* keep
Stefan> the buffer untouched after `end`.

> I thought it was ok because the region is always extended to the end of
> the line, and I think this regexp can't span lines.

Why come up with complex semantic arguments when a simple `max` ensures
the right behavior regardless of other assumptions?

> If this change is still needed, should the final goto-char also be
> treated this way?

It's not needed there, no: the important part is to avoid modifying the
buffer after `end` (although, as I said, it's not terribly bad if you
do it: you'd only get burned by it in very unusual cases).


        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.