diff options
| author | Dmitry Gutov | 2014-03-24 10:53:56 +0200 |
|---|---|---|
| committer | Dmitry Gutov | 2014-03-24 10:53:56 +0200 |
| commit | c2d6c639cf2bfdb7564bcb8706ac45b0d18dc895 (patch) | |
| tree | 4c7a039eb0ea8d39edc55e85cbe268a8086ff6f4 | |
| parent | f2999a33d0d67867997c66c777e0d6df1076e18d (diff) | |
| download | emacs-c2d6c639cf2bfdb7564bcb8706ac45b0d18dc895.tar.gz emacs-c2d6c639cf2bfdb7564bcb8706ac45b0d18dc895.zip | |
Match special globals in Ruby better
* lisp/progmodes/ruby-mode.el (ruby-expression-expansion-re):
Match special global variables without curlies, too.
(ruby-font-lock-keywords): Simplify the matcher for special global
variables. Don't require a non-word character after the variable.
Fixes: debbugs:17057
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/progmodes/ruby-mode.el | 6 |
2 files changed, 11 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f0705e5edd2..029cbaa8d95 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2014-03-24 Dmitry Gutov <dgutov@yandex.ru> | ||
| 2 | |||
| 3 | * progmodes/ruby-mode.el (ruby-expression-expansion-re): | ||
| 4 | Match special global variables without curlies, too. | ||
| 5 | (ruby-font-lock-keywords): Simplify the matcher for special global | ||
| 6 | variables. Don't require a non-word character after the variable. | ||
| 7 | (Bug#17057) | ||
| 8 | |||
| 1 | 2014-03-23 Stefan Monnier <monnier@iro.umontreal.ca> | 9 | 2014-03-23 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 10 | ||
| 3 | * simple.el (redisplay-highlight-region-function): Increase priority of | 11 | * simple.el (redisplay-highlight-region-function): Increase priority of |
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index e05aef80e86..2b8f2fa6868 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el | |||
| @@ -106,7 +106,7 @@ | |||
| 106 | "Regexp to match the beginning of a heredoc.") | 106 | "Regexp to match the beginning of a heredoc.") |
| 107 | 107 | ||
| 108 | (defconst ruby-expression-expansion-re | 108 | (defconst ruby-expression-expansion-re |
| 109 | "\\(?:[^\\]\\|\\=\\)\\(\\\\\\\\\\)*\\(#\\({[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\|\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+\\)\\)")) | 109 | "\\(?:[^\\]\\|\\=\\)\\(\\\\\\\\\\)*\\(#\\({[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\|\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+\\|\\$[^a-zA-Z \n]\\)\\)")) |
| 110 | 110 | ||
| 111 | (defun ruby-here-doc-end-match () | 111 | (defun ruby-here-doc-end-match () |
| 112 | "Return a regexp to find the end of a heredoc. | 112 | "Return a regexp to find the end of a heredoc. |
| @@ -2113,8 +2113,8 @@ See `font-lock-syntax-table'.") | |||
| 2113 | ("\\(^\\|[^:]\\)\\(:\\([-+~]@?\\|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\|@?\\(\\w\\|_\\)+\\([!?=]\\|\\b_*\\)\\|#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\)\\)" | 2113 | ("\\(^\\|[^:]\\)\\(:\\([-+~]@?\\|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\|@?\\(\\w\\|_\\)+\\([!?=]\\|\\b_*\\)\\|#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\)\\)" |
| 2114 | 2 font-lock-constant-face) | 2114 | 2 font-lock-constant-face) |
| 2115 | ;; Variables. | 2115 | ;; Variables. |
| 2116 | ("\\(\\$\\([^a-zA-Z0-9 \n]\\|[0-9]\\)\\)\\W" | 2116 | ("\\$[^a-zA-Z \n]" |
| 2117 | 1 font-lock-variable-name-face) | 2117 | 0 font-lock-variable-name-face) |
| 2118 | ("\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+" | 2118 | ("\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+" |
| 2119 | 0 font-lock-variable-name-face) | 2119 | 0 font-lock-variable-name-face) |
| 2120 | ;; Constants. | 2120 | ;; Constants. |