Subject: Re: General delimited literals in ruby-mode patch

From: Dmitry Gutov <[email-masked]>
Date: Wed, 25 Apr 2012 03:46:59 +0400

Hi Stefan,

Thanks for the answers.

On 24.04.2012 19:43, Stefan Monnier wrote:
> The maintainership is sadly unclear, indeed.  If someone could try to
> bring the two versions closer (and keep them in sync) that would be very
> appreciated.  Maybe it is enough to bring changes from the Ruby code to
> the Emacs code and not the other way around, but only if there's a clear
> understanding that the Ruby version is "deprecated" and won't see new
> development.  Also, I'm not sure the Emacs version includes all the
> functionality of the current Ruby code, so there's some work to do.

They seem to have a ticket for this, but the comments are all in 
Japanese: http://bugs.ruby-lang.org/issues/5142
And Babelfish doesn't help much.
If nobody beats me to it, I'm going to ask on the mailing list later.

>> This ruby-mode is not compatible with Emacs 23 either way.
>
> That might be: I have not verified that it is indeed
> backward compatible, I just tried to avoid consciously
> introducing incompatibilities.

To be precise, when you load it in 23.3, it complains about prog-mode's 
function definition being void.

I guess that means we don't need to worry about maintaining the "else" 
branch when implementing something that requires `syntax-propertize-rules'?

>> -                       (or (not (eq ?/ c))
>> -                           (null (nth 0 (ruby-parse-region (or begin parse-start) (point)))))
>> +                       ;; not a regexp or general delimited literal
>> +                       (null (nth 0 (ruby-parse-region (or begin parse-start) (point))))
>
> Could you explain this part of your patch?

That's a fix for indentation after percent literals delimited with 
operator characters: %r-abc-. But you seem to have already worked that out.

 > BTW, is it really true that "%Q(hello (my) world)" is correct?
 > That web-page doesn't clearly mention such nesting.

Yes, it seems to be one of the more obscure features:

irb(main):002:0> %Q(hello [(my]) world)
=> "hello [(my]) world"

It's mentioned here: http://phrogz.net/programmingruby/language.html

(to be continued)

-- Dmitry