From: Dmitry Gutov Date: Sun, 30 Jun 2013 02:23:10 +0000 (+0400) Subject: * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function): Don't X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1985 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6dbafa3000c0f39834f36adcd56d9332f7f1bc85;p=emacs.git * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function): Don't start heredoc inside a string or comment. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0506a68ceaf..aa2b3505411 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-06-30 Dmitry Gutov + + * progmodes/ruby-mode.el (ruby-syntax-propertize-function): Don't + start heredoc inside a string or comment. + 2013-06-29 Eli Zaretskii * bindings.el (visual-order-cursor-movement): New defcustom. diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index ab5634e5274..0292e40b986 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -1422,7 +1422,9 @@ It will be properly highlighted even when the call omits parens.") ("^\\(=\\)begin\\_>" (1 "!")) ;; Handle here documents. ((concat ruby-here-doc-beg-re ".*\\(\n\\)") - (7 (unless (ruby-singleton-class-p (match-beginning 0)) + (7 (unless (or (nth 8 (save-excursion + (syntax-ppss (match-beginning 0)))) + (ruby-singleton-class-p (match-beginning 0))) (put-text-property (match-beginning 7) (match-end 7) 'syntax-table (string-to-syntax "\"")) (ruby-syntax-propertize-heredoc end)))) diff --git a/test/automated/ruby-mode-tests.el b/test/automated/ruby-mode-tests.el index ad13d01a674..a18899df02f 100644 --- a/test/automated/ruby-mode-tests.el +++ b/test/automated/ruby-mode-tests.el @@ -87,6 +87,9 @@ VALUES-PLIST is a list with alternating index and value elements." (ert-deftest ruby-heredoc-highlights-interpolations () (ruby-assert-face "s = <