diff options
| author | Dmitry Gutov | 2013-06-30 06:23:10 +0400 |
|---|---|---|
| committer | Dmitry Gutov | 2013-06-30 06:23:10 +0400 |
| commit | 6dbafa3000c0f39834f36adcd56d9332f7f1bc85 (patch) | |
| tree | d3ba66f1550d9fd575450a4dc7c0e530f17d6e6a | |
| parent | c1ea3abfdeb7d25a7ff90429dd71321eb890f4f4 (diff) | |
| download | emacs-6dbafa3000c0f39834f36adcd56d9332f7f1bc85.tar.gz emacs-6dbafa3000c0f39834f36adcd56d9332f7f1bc85.zip | |
* lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function): Don't
start heredoc inside a string or comment.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/progmodes/ruby-mode.el | 4 | ||||
| -rw-r--r-- | test/automated/ruby-mode-tests.el | 3 |
3 files changed, 11 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0506a68ceaf..aa2b3505411 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-06-30 Dmitry Gutov <dgutov@yandex.ru> | ||
| 2 | |||
| 3 | * progmodes/ruby-mode.el (ruby-syntax-propertize-function): Don't | ||
| 4 | start heredoc inside a string or comment. | ||
| 5 | |||
| 1 | 2013-06-29 Eli Zaretskii <eliz@gnu.org> | 6 | 2013-06-29 Eli Zaretskii <eliz@gnu.org> |
| 2 | 7 | ||
| 3 | * bindings.el (visual-order-cursor-movement): New defcustom. | 8 | * 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.") | |||
| 1422 | ("^\\(=\\)begin\\_>" (1 "!")) | 1422 | ("^\\(=\\)begin\\_>" (1 "!")) |
| 1423 | ;; Handle here documents. | 1423 | ;; Handle here documents. |
| 1424 | ((concat ruby-here-doc-beg-re ".*\\(\n\\)") | 1424 | ((concat ruby-here-doc-beg-re ".*\\(\n\\)") |
| 1425 | (7 (unless (ruby-singleton-class-p (match-beginning 0)) | 1425 | (7 (unless (or (nth 8 (save-excursion |
| 1426 | (syntax-ppss (match-beginning 0)))) | ||
| 1427 | (ruby-singleton-class-p (match-beginning 0))) | ||
| 1426 | (put-text-property (match-beginning 7) (match-end 7) | 1428 | (put-text-property (match-beginning 7) (match-end 7) |
| 1427 | 'syntax-table (string-to-syntax "\"")) | 1429 | 'syntax-table (string-to-syntax "\"")) |
| 1428 | (ruby-syntax-propertize-heredoc end)))) | 1430 | (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." | |||
| 87 | (ert-deftest ruby-heredoc-highlights-interpolations () | 87 | (ert-deftest ruby-heredoc-highlights-interpolations () |
| 88 | (ruby-assert-face "s = <<EOS\n #{foo}\nEOS" 15 font-lock-variable-name-face)) | 88 | (ruby-assert-face "s = <<EOS\n #{foo}\nEOS" 15 font-lock-variable-name-face)) |
| 89 | 89 | ||
| 90 | (ert-deftest ruby-no-heredoc-inside-quotes () | ||
| 91 | (ruby-assert-state "\"<<\", \"\",\nfoo" 3 nil)) | ||
| 92 | |||
| 90 | (ert-deftest ruby-deep-indent () | 93 | (ert-deftest ruby-deep-indent () |
| 91 | (let ((ruby-deep-arglist nil) | 94 | (let ((ruby-deep-arglist nil) |
| 92 | (ruby-deep-indent-paren '(?\( ?\{ ?\[ ?\] t))) | 95 | (ruby-deep-indent-paren '(?\( ?\{ ?\[ ?\] t))) |