In message "Re: [ruby-core:17615] [PATCH] ruby-mode.el: Fix here-doc strings with inner quotes"
    on Sat, 5 Jul 2008 17:57:32 +0900, Nathan Weizenbaum <nex342 / gmail.com> writes:
|
|[1  <text/plain; ISO-8859-1 (7bit)>]
|At the moment, ruby-mode.el uses font-lock-keywords as opposed to 
|font-lock-syntactic-keywords to highlight here-doc strings. This means 
|that Emacs doesn't actually recognize them as strings, so unbalanced 
|quotes paint the whole buffer in font-lock-string-face. In addition, it 
|improperly highlights strings that look like nested heredocs, like the 
|following:
|
|<<FOO
|<<BAR
|BAR
|FOO
|
|The attached patch uses font-lock-syntactic-keywords instead, so that 
|heredocs actually register as strings, so stray quotation marks don't 
|wreak havoc.

I am not sure what this patch fixes.  But at least, the patched
version does not work well for the following code:

print <<FOO, <<BAR
<<BAR
foo
FOO
bar
BAR

it should highlight here-doc up to the last BAR.

							matz.