From: Bozhidar Batsov <bozhidar@batsov.com>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 16915@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 [thread overview]
Message-ID: <CFD6EE423DDE468AAC847DE8772540BD@gmail.com> (raw)
In-Reply-To: <87y50to93u.fsf@yandex.ru>
[-- Attachment #1: Type: text/plain, Size: 1308 bytes --]
On Sunday, March 2, 2014 at 12:19 AM, Dmitry Gutov wrote:
> Bozhidar Batsov <bozhidar@batsov.com (mailto:bozhidar@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.
>
>
[-- Attachment #2: Type: text/html, Size: 2196 bytes --]
next prev parent reply other threads:[~2014-03-02 11:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-01 13:31 bug#16915: 24.3.50; [ruby-mode] Comments in regexps using the extended syntax are not font-locked properly Bozhidar Batsov
2014-03-01 22:19 ` Dmitry Gutov
2014-03-02 11:03 ` Bozhidar Batsov [this message]
2014-03-02 15:03 ` Dmitry Gutov
2014-03-04 10:02 ` Bozhidar Batsov
2014-03-07 21:04 ` Stefan Monnier
2014-03-10 7:21 ` Dmitry Gutov
2014-03-10 14:40 ` Stefan Monnier
2014-03-12 7:48 ` Dmitry Gutov
2014-03-12 14:25 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CFD6EE423DDE468AAC847DE8772540BD@gmail.com \
--to=bozhidar@batsov.com \
--cc=16915@debbugs.gnu.org \
--cc=dgutov@yandex.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.