keyword-like methods on Kernel and Module with
font-lock-builtin-face.
+2013-06-21 Dmitry Gutov <dgutov@yandex.ru>
+
+ * progmodes/ruby-mode.el (ruby-font-lock-keywords): Highlight
+ keyword-like methods on Kernel and Module with
+ font-lock-builtin-face.
+
2013-06-21 Stephen Berman <stephen.berman@gmx.net>
* obsolete/otodo-mode.el: Move and rename from calendar/todo-mode.el.
;; functions
'("^\\s *def\\s +\\([^( \t\n]+\\)"
1 font-lock-function-name-face)
- ;; keywords
- (cons (concat
- "\\(^\\|[^.@$]\\|\\.\\.\\)\\_<\\(defined\\?\\|"
+ (list (concat
+ "\\(^\\|[^.@$]\\|\\.\\.\\)\\("
+ ;; keywords
(regexp-opt
- '("alias_method"
- "alias"
+ '("alias"
"and"
"begin"
"break"
"catch"
"class"
"def"
+ "defined?"
"do"
"elsif"
"else"
"end"
"if"
"in"
- "module_function"
"module"
"next"
"not"
"or"
- "public"
- "private"
- "protected"
- "raise"
"redo"
"rescue"
"retry"
"return"
"then"
- "throw"
"super"
"unless"
"undef"
"when"
"while"
"yield")
- t)
- "\\)"
- ruby-keyword-end-re)
- 2)
+ 'symbols)
+ "\\|"
+ ;; keyword-like methods on Kernel and Module
+ (regexp-opt
+ '("alias_method"
+ "autoload"
+ "module_function"
+ "private"
+ "protected"
+ "public"
+ "raise"
+ "require"
+ "require_relative"
+ "throw")
+ 'symbols)
+ "\\)")
+ 2
+ '(if (match-beginning 4)
+ font-lock-builtin-face
+ font-lock-keyword-face))
;; here-doc beginnings
`(,ruby-here-doc-beg-re 0 (unless (ruby-singleton-class-p (match-beginning 0))
'font-lock-string-face))