[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#17057: 24.3.50; [ruby-mode] Font-locking of special global variables

From: Bozhidar Batsov
Subject: bug#17057: 24.3.50; [ruby-mode] Font-locking of special global variables like $$ is broken(missing)
Date: Wed, 26 Mar 2014 14:42:51 +0200

I didn’t include them in RuboCop’s code since they actually constitute a different syntactic category according to the parser - a “nth-reference”. I don’t think we should care about this in ruby-mode, though. The patch looks great. Given the fact that Emacs releases are pretty far apart (usually more than 1 year) I think we should include this given that’s if virtually impossible to introduce a regression.


On Wednesday, March 26, 2014 at 2:35 PM, Dmitry Gutov wrote:

On 24.03.2014 11:45, Bozhidar Batsov wrote:

Yeah, seems that everything important is listed there. Here’s one a bit
more extensive list, though:

It features the JRuby-specific global vars in addition to the standard

I see that you don't include the $(digit) globals, which reference the
last regexp-matched groups. The patch below does.

Not sure if it's okay to install in 24.4, though: on the one hand it's
low-risk, on the other hand it's not a bugfix.

=== modified file 'lisp/progmodes/ruby-mode.el'
--- lisp/progmodes/ruby-mode.el 2014-03-24 08:53:56 +0000
+++ lisp/progmodes/ruby-mode.el 2014-03-26 11:33:42 +0000
@@ -2108,13 +2108,28 @@
1 font-lock-variable-name-face)
;; Keywords that evaluate to certain values.
- (0 font-lock-variable-name-face))
+ (0 font-lock-builtin-face))
;; Symbols.
2 font-lock-constant-face)
- ;; Variables.
- ("\\$[^a-zA-Z \n]"
- 0 font-lock-variable-name-face)
+ ;; Special variables.
+ (,(concat "\\$\\(?:[:\"!@;,/\\._><\\$?~=*&`'+0-9]\\|-[0adFiIlpvw]\\|"
+ "LAST_PAREN_MATCH" "stdin" "stdout" "stderr"
+ "\\_>\\)")
+ 0 font-lock-builtin-face)
0 font-lock-variable-name-face)
;; Constants.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]