Subject: bug#7735: A questing mark at the end of a string in ruby-mode

From: Chong Yidong <[email-masked]>
Date: Sat, 22 Jan 2011 20:07:13 -0500

Lennart Borgman <[email-masked]> writes:

> A question mark at the end of a string makes ruby-mode believe the
> string does not end there.
>
> To show this place the following in a ruby-mode buffer:
>
>   re_str = wild.join(".*?")
>   re = Regexp.new(re_str, 1)

This bug was appeared during the introduction of syntax-propertize.
Stefan, could you take a look?

2010-09-10  Stefan Monnier  <[email-masked]>

  * progmodes/ruby-mode.el (ruby-here-doc-beg-re):
  Define while compiling.
  (ruby-here-doc-end-re, ruby-here-doc-beg-match)
  (ruby-font-lock-syntactic-keywords, ruby-comment-beg-syntax)
  (syntax-ppss, ruby-in-ppss-context-p, ruby-in-here-doc-p)
  (ruby-here-doc-find-end, ruby-here-doc-beg-syntax)
  (ruby-here-doc-end-syntax): Only define when
  syntax-propertize is not available.
  (ruby-syntax-propertize-function, ruby-syntax-propertize-heredoc):
  New functions.
  (ruby-in-ppss-context-p): Update to new syntax of heredocs.
  (electric-indent-chars): Silence bytecompiler.
  (ruby-mode): Use prog-mode, syntax-propertize-function, and
  electric-indent-chars.