emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r113128: * lisp/progmodes/ruby-mode.el (ruby-font-lo


From: Dmitry Gutov
Subject: [Emacs-diffs] trunk r113128: * lisp/progmodes/ruby-mode.el (ruby-font-lock-keywords): Highlight
Date: Fri, 21 Jun 2013 23:07:51 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 113128
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Gutov <address@hidden>
branch nick: trunk
timestamp: Sat 2013-06-22 03:07:49 +0400
message:
  * lisp/progmodes/ruby-mode.el (ruby-font-lock-keywords): Highlight
  keyword-like methods on Kernel and Module with
  font-lock-builtin-face.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/progmodes/ruby-mode.el    
rubymode.el-20091113204419-o5vbwnq5f7feedwu-8804
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-06-21 21:55:44 +0000
+++ b/lisp/ChangeLog    2013-06-21 23:07:49 +0000
@@ -1,3 +1,9 @@
+2013-06-21  Dmitry Gutov  <address@hidden>
+
+       * 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  <address@hidden>
 
        * obsolete/otodo-mode.el: Move and rename from calendar/todo-mode.el.

=== modified file 'lisp/progmodes/ruby-mode.el'
--- a/lisp/progmodes/ruby-mode.el       2013-06-18 22:17:56 +0000
+++ b/lisp/progmodes/ruby-mode.el       2013-06-21 23:07:49 +0000
@@ -1726,12 +1726,11 @@
    ;; functions
    '("^\\s *def\\s +\\([^( \t\n]+\\)"
      1 font-lock-function-name-face)
-   ;; keywords
-   (cons (concat
-          "\\(^\\|address@hidden|\\.\\.\\)\\_<\\(defined\\?\\|"
+   (list (concat
+          "\\(^\\|address@hidden|\\.\\.\\)\\("
+          ;; keywords
           (regexp-opt
-           '("alias_method"
-             "alias"
+           '("alias"
              "and"
              "begin"
              "break"
@@ -1739,6 +1738,7 @@
              "catch"
              "class"
              "def"
+             "defined?"
              "do"
              "elsif"
              "else"
@@ -1748,21 +1748,15 @@
              "end"
              "if"
              "in"
-             "module_function"
              "module"
              "next"
              "not"
              "or"
-             "public"
-             "private"
-             "protected"
-             "raise"
              "redo"
              "rescue"
              "retry"
              "return"
              "then"
-             "throw"
              "super"
              "unless"
              "undef"
@@ -1770,10 +1764,26 @@
              "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))


reply via email to

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