aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2014-02-01 19:06:08 +0200
committerDmitry Gutov2014-02-01 19:06:08 +0200
commit68e004e0cd5b4aeed339e08a103e6b060b93cae2 (patch)
tree2b0002d8801abea750a82492952ce170b1da9058
parenta09beb3df21677b0797e27cb75bd5c66226f6bc9 (diff)
downloademacs-68e004e0cd5b4aeed339e08a103e6b060b93cae2.tar.gz
emacs-68e004e0cd5b4aeed339e08a103e6b060b93cae2.zip
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.
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/progmodes/ruby-mode.el44
2 files changed, 29 insertions, 18 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4903bfdd1d9..b2adc2cf881 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -4,6 +4,9 @@
4 `:' before binary operators (bug#16609). Don't check for `:' 4 `:' before binary operators (bug#16609). Don't check for `:'
5 before `[' and `(', or their syntax status. A percent literal 5 before `[' and `(', or their syntax status. A percent literal
6 can't end with either. 6 can't end with either.
7 (ruby-font-lock-keywords): For built-ins that require arguments,
8 check that they're followed by something that looks like argument
9 (bug#16610).
7 10
82014-02-01 Lars Ingebrigtsen <larsi@gnus.org> 112014-02-01 Lars Ingebrigtsen <larsi@gnus.org>
9 12
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 5cee77b29a5..22de9a83f2b 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -2017,27 +2017,17 @@ See `font-lock-syntax-table'.")
2017 "yield") 2017 "yield")
2018 'symbols)) 2018 'symbols))
2019 (1 font-lock-keyword-face)) 2019 (1 font-lock-keyword-face))
2020 ;; Some core methods. 2020 ;; Core methods that have required arguments.
2021 (,(concat 2021 (,(concat
2022 ruby-font-lock-keyword-beg-re 2022 ruby-font-lock-keyword-beg-re
2023 (regexp-opt 2023 (regexp-opt
2024 '( ;; built-in methods on Kernel 2024 '( ;; built-in methods on Kernel
2025 "__callee__"
2026 "__dir__"
2027 "__method__"
2028 "abort"
2029 "at_exit" 2025 "at_exit"
2030 "autoload" 2026 "autoload"
2031 "autoload?" 2027 "autoload?"
2032 "binding"
2033 "block_given?"
2034 "caller"
2035 "catch" 2028 "catch"
2036 "eval" 2029 "eval"
2037 "exec" 2030 "exec"
2038 "exit"
2039 "exit!"
2040 "fail"
2041 "fork" 2031 "fork"
2042 "format" 2032 "format"
2043 "lambda" 2033 "lambda"
@@ -2050,19 +2040,12 @@ See `font-lock-syntax-table'.")
2050 "proc" 2040 "proc"
2051 "putc" 2041 "putc"
2052 "puts" 2042 "puts"
2053 "raise"
2054 "rand"
2055 "readline"
2056 "readlines"
2057 "require" 2043 "require"
2058 "require_relative" 2044 "require_relative"
2059 "sleep"
2060 "spawn" 2045 "spawn"
2061 "sprintf" 2046 "sprintf"
2062 "srand"
2063 "syscall" 2047 "syscall"
2064 "system" 2048 "system"
2065 "throw"
2066 "trap" 2049 "trap"
2067 "warn" 2050 "warn"
2068 ;; keyword-like private methods on Module 2051 ;; keyword-like private methods on Module
@@ -2082,6 +2065,31 @@ See `font-lock-syntax-table'.")
2082 "refine" 2065 "refine"
2083 "using") 2066 "using")
2084 'symbols)) 2067 'symbols))
2068 (1 (unless (looking-at " *\\(?:[]|,.)}]\\|$\\)")
2069 font-lock-builtin-face)))
2070 ;; Kernel methods that have no required arguments.
2071 (,(concat
2072 ruby-font-lock-keyword-beg-re
2073 (regexp-opt
2074 '("__callee__"
2075 "__dir__"
2076 "__method__"
2077 "abort"
2078 "at_exit"
2079 "binding"
2080 "block_given?"
2081 "caller"
2082 "exit"
2083 "exit!"
2084 "fail"
2085 "raise"
2086 "rand"
2087 "readline"
2088 "readlines"
2089 "sleep"
2090 "srand"
2091 "throw")
2092 'symbols))
2085 (1 font-lock-builtin-face)) 2093 (1 font-lock-builtin-face))
2086 ;; Here-doc beginnings. 2094 ;; Here-doc beginnings.
2087 (,ruby-here-doc-beg-re 2095 (,ruby-here-doc-beg-re