GNU bug report logs - #16915
24.3.50; [ruby-mode] Comments in regexps using the extended syntax are not font-locked properly

Previous Next

Package: emacs;

Reported by: Bozhidar Batsov <bozhidar <at> batsov.com>

Date: Sat, 1 Mar 2014 13:32:01 UTC

Severity: minor

Found in version 24.3.50

Full log


View this message in rfc822 format

From: Bozhidar Batsov <bozhidar <at> batsov.com>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 16915 <at> debbugs.gnu.org
Subject: bug#16915: 24.3.50; [ruby-mode] Comments in regexps using the extended syntax are not font-locked properly
Date: Sun, 2 Mar 2014 13:03:14 +0200
[Message part 1 (text/plain, inline)]
On Sunday, March 2, 2014 at 12:19 AM, Dmitry Gutov wrote:
> Bozhidar Batsov <bozhidar <at> batsov.com (mailto:bozhidar <at> batsov.com)> writes:
>  
> > In most editors/IDEs code like this
> >  
> > regexp = /
> > start # some text
> > \s # white space char
> > (group) # first group
> > (?:alt1|alt2) # some alternation
> > end
> > /x
> >  
> > will have the comments font-locked as comments, because comments are
> > allowed in the extended regexp literal syntax (/x). It would be nice
> > if this was taken into account in ruby-mode as well.
> >  
>  
>  
> Not sure how to implement it best.
>  
> Ideally, we'd have a new kind of syntax instead of strings (native
> regexp support?), which would make font-lock fontify comments inside.
>  
> Or maybe a modifier on the string syntax?
Native regexp support is preferable IMO. After all - regexps are not strings. If they were treated differently we’d also be able to have extra highlighting for things like named groups, quantifiers, regexp classes, etc. I guess, however, that this would require a lot of work.
>  
> Of course, we could just scan the contents of every regexp, look for any
> hash character that doesn't look like it starts interpolation, and
> forcibly fontify the text from it till the end of line.
>  
>  


[Message part 2 (text/html, inline)]

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

Previous Next


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