Subject: bug#15874: 24.3.50; exit! not properly font-locked in ruby-mode

From: Stefan Monnier <[email-masked]>
Date: Thu, 05 Dec 2013 23:57:49 -0500

> Not mandatory, just good for performance, AFAICT. Instead of maching all
> identifiers that look like methods and then finding out that most of
> them don't end with ? or ! anyway, it would be faster to scan the buffer
> for ? or !, and then look a bit back and see if the text before such a
> character resembles a method name.

We can also do that, using a "[?!]" regexp and then do the "look a bit
back" in Elisp.

> That looks good, but, like you mentioned later, if we had a dedicated
> backslash-sequence, it could also transparently handle the EOB case.
> I guess, the question is, would it see much use.

But then it would be a lot more special cased.

> `regexp-opt' seems to be the primary use case to me.

I think the second arg to `regexp-opt' is a misfeature.

> irb(main):026:0> a = 5
> => 5
> irb(main):027:0> a?3:4
> SyntaxError: (irb):27: syntax error, unexpected ':', expecting $end
> a?3:4
>     ^
> 	from /home/gutov/.rbenv/versions/1.9.3-p429/bin/irb:12:in `<main>'

Good.

        Stefan