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 /lisp/progmodes/ruby-mode.el | |
| 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.
Diffstat (limited to 'lisp/progmodes/ruby-mode.el')
| -rw-r--r-- | lisp/progmodes/ruby-mode.el | 11 |
1 files changed, 9 insertions, 2 deletions
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))))) |