Subject: Re: bug#16915: 24.3.50; [ruby-mode] Comments in regexps using the extended syntax are not font-locked properly

From: Dmitry Gutov <[email-masked]>
Date: Mon, 10 Mar 2014 09:21:02 +0200

On 07.03.2014 23:04, Stefan Monnier wrote:
> My preference would be to think about it as a "multi-mode" case, and
> hence make it possible to specify a different syntax-table to use within
> the regexp.

I remember this idea, but have a hard time viewing it in the context of 
our latest discussion on the subject of multi-modes.

First, why only syntax-table? For this specific case, a syntax table 
change is not required, we only need to be able to view the text between 
/'s as a separate context (but - and this is a change from certain other 
multi-mode uses - still fontify uncommented text inside them with the 
regexp face). But in the general case, we would at least want to be able 
to change font-lock-keywords, too.

> I think of it along the lines of a new syntax-class, applied to the "/"
> char, which would change the syntax-table for the subsequent text.

How would this interact with a new hook that would `syntax-ppss' would 
run on the cached entries?

Would its default value look for the chars bearing the new syntax class?