Subject: Re: bug#16078: Extensive docs and tests for `ruby-forward-string' (PATCH)

From: Cameron Desautels <[email-masked]>
Date: Sat, 7 Dec 2013 20:29:15 -0600

Hi Dmitry,

Thank you for explaining the recent changes.  I did see a lot of
duplicated parsing code and wasn't completely sure what the reason for
it was.  I read up a bit on SMIE so that makes sense now.

However, I've done additional testing on the current trunk and the
issue persists.

As a minimal example to recreate the issue, create a new file with the
following contents (indentation removed):

    def foo
      %^bar^
    end

Turn on ruby-mode, and run `imenu-add-menubar-index'.  You will get
the following error:

    Error in menu-bar-update-hook (imenu-update-menubar):
(invalid-regexp "Unmatched [ or [^")

(Note that if you run it again it will appear to work--run `imenu' to
see the error again.)  This stems from the bug in
`ruby-forward-string' that my patch fixes.

I have not signed the copyright assignment papers but I am willing.

Thanks.
--
Cameron Desautels <[email-masked]>

On Fri, Dec 6, 2013 at 9:22 PM, Dmitry Gutov <[email-masked]> wrote:
> Hi Cameron,
>
> Cameron Desautels <[email-masked]> writes:
>
>> The attached patch adds extensive documentation and tests to the
>> `ruby-forward-string' function.
>>
>> This may seem an odd function to document thoroughly, but I spent
>> quite a while wrapping my head around the exact behavior and I want to
>> spare the next person.  It also underlies some important parsing
>> functionality in ruby-mode.
>
> Thank you for your effort, but it probably would've been more valuable a
> few months ago or earlier.  The ruby-mode that will be released with
> Emacs 24.4 has switched to using SMIE for indentation and sexp
> navigation by default, and it leaves quite a bit of the old,
> undocumented code unused.
>
> Whatever code examples and functionality didn't work for you, have you
> tried them with the current trunk?
>
> We can still use the two patches, of course, since the old indentation
> engine can still be enabled with `(setq ruby-use-smie nil)', but they
> exceed the 15 line limit and will require copyright assignment (AFAIR,
> we do require those even for test code).  Have you signed, or are you
> willing to sign the copyright assignment papers?