emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r113226: * lisp/progmodes/ruby-mode.el (ruby-syntax-


From: Dmitry Gutov
Subject: [Emacs-diffs] trunk r113226: * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function): Don't
Date: Sun, 30 Jun 2013 02:23:13 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 113226
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Gutov <address@hidden>
branch nick: trunk
timestamp: Sun 2013-06-30 06:23:10 +0400
message:
  * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function): Don't
  start heredoc inside a string or comment.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/progmodes/ruby-mode.el    
rubymode.el-20091113204419-o5vbwnq5f7feedwu-8804
  test/automated/ruby-mode-tests.el 
rubymodetests.el-20120720101201-mn39s4kfopdxj3ek-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-06-29 20:19:29 +0000
+++ b/lisp/ChangeLog    2013-06-30 02:23:10 +0000
@@ -1,3 +1,8 @@
+2013-06-30  Dmitry Gutov  <address@hidden>
+
+       * progmodes/ruby-mode.el (ruby-syntax-propertize-function): Don't
+       start heredoc inside a string or comment.
+
 2013-06-29  Eli Zaretskii  <address@hidden>
 
        * bindings.el (visual-order-cursor-movement): New defcustom.

=== modified file 'lisp/progmodes/ruby-mode.el'
--- a/lisp/progmodes/ruby-mode.el       2013-06-22 13:25:43 +0000
+++ b/lisp/progmodes/ruby-mode.el       2013-06-30 02:23:10 +0000
@@ -1422,7 +1422,9 @@
             ("^\\(=\\)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))))

=== modified file 'test/automated/ruby-mode-tests.el'
--- a/test/automated/ruby-mode-tests.el 2013-06-18 22:17:56 +0000
+++ b/test/automated/ruby-mode-tests.el 2013-06-30 02:23:10 +0000
@@ -87,6 +87,9 @@
 (ert-deftest ruby-heredoc-highlights-interpolations ()
   (ruby-assert-face "s = <<EOS\n  #{foo}\nEOS" 15 
font-lock-variable-name-face))
 
+(ert-deftest ruby-no-heredoc-inside-quotes ()
+  (ruby-assert-state "\"<<\", \"\",\nfoo" 3 nil))
+
 (ert-deftest ruby-deep-indent ()
   (let ((ruby-deep-arglist nil)
         (ruby-deep-indent-paren '(?\( ?\{ ?\[ ?\] t)))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]