emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r116234: Fix bug#16610


From: Dmitry Gutov
Subject: [Emacs-diffs] trunk r116234: Fix bug#16610
Date: Sat, 01 Feb 2014 17:06:17 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116234
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/16610
committer: Dmitry Gutov <address@hidden>
branch nick: trunk
timestamp: Sat 2014-02-01 19:06:08 +0200
message:
  Fix bug#16610
  
  * lisp/progmodes/ruby-mode.el (ruby-font-lock-keywords): For built-ins
  that require arguments, check that they're followed by something that
  looks like argument.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/progmodes/ruby-mode.el    
rubymode.el-20091113204419-o5vbwnq5f7feedwu-8804
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-02-01 14:54:58 +0000
+++ b/lisp/ChangeLog    2014-02-01 17:06:08 +0000
@@ -4,6 +4,9 @@
        `:' before binary operators (bug#16609).  Don't check for `:'
        before `[' and `(', or their syntax status.  A percent literal
        can't end with either.
+       (ruby-font-lock-keywords): For built-ins that require arguments,
+       check that they're followed by something that looks like argument
+       (bug#16610).
 
 2014-02-01  Lars Ingebrigtsen  <address@hidden>
 

=== modified file 'lisp/progmodes/ruby-mode.el'
--- a/lisp/progmodes/ruby-mode.el       2014-02-01 14:54:58 +0000
+++ b/lisp/progmodes/ruby-mode.el       2014-02-01 17:06:08 +0000
@@ -2017,27 +2017,17 @@
           "yield")
         'symbols))
      (1 font-lock-keyword-face))
-    ;; Some core methods.
+    ;; Core methods that have required arguments.
     (,(concat
        ruby-font-lock-keyword-beg-re
        (regexp-opt
         '( ;; built-in methods on Kernel
-          "__callee__"
-          "__dir__"
-          "__method__"
-          "abort"
           "at_exit"
           "autoload"
           "autoload?"
-          "binding"
-          "block_given?"
-          "caller"
           "catch"
           "eval"
           "exec"
-          "exit"
-          "exit!"
-          "fail"
           "fork"
           "format"
           "lambda"
@@ -2050,19 +2040,12 @@
           "proc"
           "putc"
           "puts"
-          "raise"
-          "rand"
-          "readline"
-          "readlines"
           "require"
           "require_relative"
-          "sleep"
           "spawn"
           "sprintf"
-          "srand"
           "syscall"
           "system"
-          "throw"
           "trap"
           "warn"
           ;; keyword-like private methods on Module
@@ -2082,6 +2065,31 @@
           "refine"
           "using")
         'symbols))
+     (1 (unless (looking-at " *\\(?:[]|,.)}]\\|$\\)")
+          font-lock-builtin-face)))
+    ;; Kernel methods that have no required arguments.
+    (,(concat
+       ruby-font-lock-keyword-beg-re
+       (regexp-opt
+        '("__callee__"
+          "__dir__"
+          "__method__"
+          "abort"
+          "at_exit"
+          "binding"
+          "block_given?"
+          "caller"
+          "exit"
+          "exit!"
+          "fail"
+          "raise"
+          "rand"
+          "readline"
+          "readlines"
+          "sleep"
+          "srand"
+          "throw")
+        'symbols))
      (1 font-lock-builtin-face))
     ;; Here-doc beginnings.
     (,ruby-here-doc-beg-re


reply via email to

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