diff options
| author | Dmitry Gutov | 2013-12-06 06:22:08 +0200 |
|---|---|---|
| committer | Dmitry Gutov | 2013-12-06 06:22:08 +0200 |
| commit | af67e79a52a3db028dc6a066f6e87b87a8190cc9 (patch) | |
| tree | 331ab904d5cbff89dad8499f20834ef1520a70f4 | |
| parent | bf09320951c0c1c1831a929a0330f574e78afd49 (diff) | |
| download | emacs-af67e79a52a3db028dc6a066f6e87b87a8190cc9.tar.gz emacs-af67e79a52a3db028dc6a066f6e87b87a8190cc9.zip | |
Fix Bug#15874
* lisp/progmodes/ruby-mode.el (ruby-mode-syntax-table): Don't modify
syntax for `?'.
(ruby-expr-beg): Expect that `!' will have syntax class "symbol"
where appropriate already.
(ruby-syntax-propertize-function): Propertize `?' and `!' at the
end of method names.
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/progmodes/ruby-mode.el | 11 | ||||
| -rw-r--r-- | test/automated/ruby-mode-tests.el | 3 |
3 files changed, 19 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1fd715dda59..3877d053199 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2013-12-06 Dmitry Gutov <dgutov@yandex.ru> | ||
| 2 | |||
| 3 | * progmodes/ruby-mode.el (ruby-mode-syntax-table): Don't modify | ||
| 4 | syntax for `?'. | ||
| 5 | (ruby-expr-beg): Expect that `!' will have syntax class "symbol" | ||
| 6 | where appropriate already. | ||
| 7 | (ruby-syntax-propertize-function): Propertize `?' and `!' at the | ||
| 8 | end of method names (Bug#15874). | ||
| 9 | |||
| 1 | 2013-12-06 Juri Linkov <juri@jurta.org> | 10 | 2013-12-06 Juri Linkov <juri@jurta.org> |
| 2 | 11 | ||
| 3 | * isearch.el (isearch--saved-overriding-local-map): | 12 | * isearch.el (isearch--saved-overriding-local-map): |
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 4258303cd8c..be12b1474c3 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el | |||
| @@ -186,7 +186,6 @@ This should only be called after matching against `ruby-here-doc-beg-re'." | |||
| 186 | (modify-syntax-entry ?\n ">" table) | 186 | (modify-syntax-entry ?\n ">" table) |
| 187 | (modify-syntax-entry ?\\ "\\" table) | 187 | (modify-syntax-entry ?\\ "\\" table) |
| 188 | (modify-syntax-entry ?$ "." table) | 188 | (modify-syntax-entry ?$ "." table) |
| 189 | (modify-syntax-entry ?? "_" table) | ||
| 190 | (modify-syntax-entry ?_ "_" table) | 189 | (modify-syntax-entry ?_ "_" table) |
| 191 | (modify-syntax-entry ?: "_" table) | 190 | (modify-syntax-entry ?: "_" table) |
| 192 | (modify-syntax-entry ?< "." table) | 191 | (modify-syntax-entry ?< "." table) |
| @@ -783,7 +782,7 @@ Can be one of `heredoc', `modifier', `expr-qstr', `expr-re'." | |||
| 783 | ruby-block-mid-keywords) | 782 | ruby-block-mid-keywords) |
| 784 | 'words)) | 783 | 'words)) |
| 785 | (goto-char (match-end 0)) | 784 | (goto-char (match-end 0)) |
| 786 | (not (looking-at "\\s_\\|!"))) | 785 | (not (looking-at "\\s_"))) |
| 787 | ((eq option 'expr-qstr) | 786 | ((eq option 'expr-qstr) |
| 788 | (looking-at "[a-zA-Z][a-zA-z0-9_]* +%[^ \t]")) | 787 | (looking-at "[a-zA-Z][a-zA-z0-9_]* +%[^ \t]")) |
| 789 | ((eq option 'expr-re) | 788 | ((eq option 'expr-re) |
| @@ -1648,6 +1647,14 @@ It will be properly highlighted even when the call omits parens.") | |||
| 1648 | ;; Not within a string. | 1647 | ;; Not within a string. |
| 1649 | (nth 3 (syntax-ppss (match-beginning 0)))) | 1648 | (nth 3 (syntax-ppss (match-beginning 0)))) |
| 1650 | (string-to-syntax "\\")))) | 1649 | (string-to-syntax "\\")))) |
| 1650 | ;; Part of symbol when at the end of a method name. | ||
| 1651 | ("[!?]" | ||
| 1652 | (0 (unless (save-excursion | ||
| 1653 | (or (nth 8 (syntax-ppss (match-beginning 0))) | ||
| 1654 | (let (parse-sexp-lookup-properties) | ||
| 1655 | (or (zerop (skip-syntax-backward "w_")) | ||
| 1656 | (memq (preceding-char) '(?@ ?$)))))) | ||
| 1657 | (string-to-syntax "_")))) | ||
| 1651 | ;; Regular expressions. Start with matching unescaped slash. | 1658 | ;; Regular expressions. Start with matching unescaped slash. |
| 1652 | ("\\(?:\\=\\|[^\\]\\)\\(?:\\\\\\\\\\)*\\(/\\)" | 1659 | ("\\(?:\\=\\|[^\\]\\)\\(?:\\\\\\\\\\)*\\(/\\)" |
| 1653 | (1 (let ((state (save-excursion (syntax-ppss (match-beginning 1))))) | 1660 | (1 (let ((state (save-excursion (syntax-ppss (match-beginning 1))))) |
diff --git a/test/automated/ruby-mode-tests.el b/test/automated/ruby-mode-tests.el index f59b8db86e9..9c121169756 100644 --- a/test/automated/ruby-mode-tests.el +++ b/test/automated/ruby-mode-tests.el | |||
| @@ -91,8 +91,7 @@ VALUES-PLIST is a list with alternating index and value elements." | |||
| 91 | (ert-deftest ruby-no-heredoc-inside-quotes () | 91 | (ert-deftest ruby-no-heredoc-inside-quotes () |
| 92 | (ruby-assert-state "\"<<\", \"\",\nfoo" 3 nil)) | 92 | (ruby-assert-state "\"<<\", \"\",\nfoo" 3 nil)) |
| 93 | 93 | ||
| 94 | ;; Change result if you fix http://debbugs.gnu.org/15874 | 94 | (ert-deftest ruby-exit!-font-lock () |
| 95 | (ert-deftest ruby-exit!-font-lock () :expected-result :failed | ||
| 96 | (ruby-assert-face "exit!" 5 font-lock-builtin-face)) | 95 | (ruby-assert-face "exit!" 5 font-lock-builtin-face)) |
| 97 | 96 | ||
| 98 | (ert-deftest ruby-deep-indent () | 97 | (ert-deftest ruby-deep-indent () |