From: Dmitry Gutov Date: Fri, 31 May 2013 16:55:03 +0000 (+0400) Subject: * lisp/progmodes/ruby-mode.el (ruby-syntax-expansion-allowed-p): X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~2026^2~112 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=973d1e126c7c960f23fb7f2334394cad91d72e87;p=emacs.git * lisp/progmodes/ruby-mode.el (ruby-syntax-expansion-allowed-p): Highlight expansions inside regexp literals. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index edc28fcd5b7..d87b9960d49 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-05-31 Dmitry Gutov + + * progmodes/ruby-mode.el (ruby-syntax-expansion-allowed-p): + Highlight expansions inside regexp literals. + 2013-05-31 Glenn Morris * obsolete/sym-comp.el (symbol-complete): diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index b7a635199ab..fa4efe49b7b 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -1513,7 +1513,7 @@ It will be properly highlighted even when the call omits parens.") "Return non-nil if expression expansion is allowed." (let ((term (nth 3 parse-state))) (cond - ((memq term '(?\" ?` ?\n))) + ((memq term '(?\" ?` ?\n ?/))) ((eq term t) (save-match-data (save-excursion diff --git a/test/automated/ruby-mode-tests.el b/test/automated/ruby-mode-tests.el index 6ed2a8ad377..77dd62821f7 100644 --- a/test/automated/ruby-mode-tests.el +++ b/test/automated/ruby-mode-tests.el @@ -112,6 +112,9 @@ VALUES-PLIST is a list with alternating index and value elements." (ert-deftest ruby-regexp-starts-after-string () (ruby-assert-state "'(/', /\d+/" 3 ?/ 8)) +(ert-deftest ruby-regexp-interpolation-is-highlighted () + (ruby-assert-face "/#{foobs}/" 4 font-lock-variable-name-face)) + (ert-deftest ruby-regexp-skips-over-interpolation () (ruby-assert-state "/#{foobs.join('/')}/" 3 nil))