aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorDmitry Gutov2013-07-03 19:46:45 +0400
committerDmitry Gutov2013-07-03 19:46:45 +0400
commit56f75efcbccb786aa6a570032b2541ee917ce5ff (patch)
tree8686ced0d0231480c9b321e68589c252456ef747 /lisp
parentdb7863f422260758d9e0fc5e3bf71fae0e8aabb4 (diff)
downloademacs-56f75efcbccb786aa6a570032b2541ee917ce5ff.tar.gz
emacs-56f75efcbccb786aa6a570032b2541ee917ce5ff.zip
* lisp/progmodes/ruby-mode.el (ruby-font-lock-keywords): Highlight more
keywords and built-ins.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/progmodes/ruby-mode.el62
2 files changed, 56 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9e746b25146..237518c3eea 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12013-07-03 Dmitry Gutov <dgutov@yandex.ru>
2
3 * progmodes/ruby-mode.el (ruby-font-lock-keywords): Highlight more
4 keywords and built-ins.
5
12013-07-03 Glenn Morris <rgm@gnu.org> 62013-07-03 Glenn Morris <rgm@gnu.org>
2 7
3 * subr.el (y-or-n-p): Handle empty prompts. (Bug#14770) 8 * subr.el (y-or-n-p): Handle empty prompts. (Bug#14770)
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index f5f829ce0e8..5f92d197a66 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -1762,31 +1762,67 @@ See `font-lock-syntax-table'.")
1762 "yield") 1762 "yield")
1763 'symbols) 1763 'symbols)
1764 "\\|" 1764 "\\|"
1765 ;; keyword-like methods on Kernel and Module
1766 (regexp-opt 1765 (regexp-opt
1767 '("alias_method" 1766 ;; built-in methods on Kernel
1767 '("__callee__"
1768 "__dir__"
1769 "__method__"
1770 "abort"
1771 "at_exit"
1772 "autoload"
1773 "autoload?"
1774 "binding"
1775 "block_given?"
1776 "caller"
1777 "catch"
1778 "eval"
1779 "exec"
1780 "exit"
1781 "exit!"
1782 "fail"
1783 "fork"
1784 "format"
1785 "lambda"
1786 "load"
1787 "loop"
1788 "open"
1789 "p"
1790 "print"
1791 "printf"
1792 "proc"
1793 "putc"
1794 "puts"
1795 "raise"
1796 "rand"
1797 "readline"
1798 "readlines"
1799 "require"
1800 "require_relative"
1801 "sleep"
1802 "spawn"
1803 "sprintf"
1804 "srand"
1805 "syscall"
1806 "system"
1807 "throw"
1808 "trap"
1809 "warn"
1810 ;; keyword-like private methods on Module
1811 "alias_method"
1768 "autoload" 1812 "autoload"
1769 "attr" 1813 "attr"
1770 "attr_accessor" 1814 "attr_accessor"
1771 "attr_reader" 1815 "attr_reader"
1772 "attr_writer" 1816 "attr_writer"
1773 "catch"
1774 "define_method" 1817 "define_method"
1775 "extend" 1818 "extend"
1776 "fail"
1777 "include" 1819 "include"
1778 "lambda"
1779 "loop"
1780 "module_function" 1820 "module_function"
1821 "prepend"
1781 "private" 1822 "private"
1782 "proc"
1783 "protected" 1823 "protected"
1784 "public" 1824 "public"
1785 "raise"
1786 "refine" 1825 "refine"
1787 "require"
1788 "require_relative"
1789 "throw"
1790 "using") 1826 "using")
1791 'symbols) 1827 'symbols)
1792 "\\)") 1828 "\\)")
@@ -1794,12 +1830,16 @@ See `font-lock-syntax-table'.")
1794 '(if (match-beginning 4) 1830 '(if (match-beginning 4)
1795 font-lock-builtin-face 1831 font-lock-builtin-face
1796 font-lock-keyword-face)) 1832 font-lock-keyword-face))
1833 ;; Perl-ish keywords
1834 "\\_<\\(?:BEGIN\\|END\\)\\_>\\|^__END__$"
1797 ;; here-doc beginnings 1835 ;; here-doc beginnings
1798 `(,ruby-here-doc-beg-re 0 (unless (ruby-singleton-class-p (match-beginning 0)) 1836 `(,ruby-here-doc-beg-re 0 (unless (ruby-singleton-class-p (match-beginning 0))
1799 'font-lock-string-face)) 1837 'font-lock-string-face))
1800 ;; variables 1838 ;; variables
1801 '("\\(^\\|[^.@$]\\|\\.\\.\\)\\_<\\(nil\\|self\\|true\\|false\\)\\>" 1839 '("\\(^\\|[^.@$]\\|\\.\\.\\)\\_<\\(nil\\|self\\|true\\|false\\)\\>"
1802 2 font-lock-variable-name-face) 1840 2 font-lock-variable-name-face)
1841 ;; keywords that evaluate to certain values
1842 '("\\_<__\\(?:LINE\\|ENCODING\\|FILE\\)__\\_>" 0 font-lock-variable-name-face)
1803 ;; symbols 1843 ;; symbols
1804 '("\\(^\\|[^:]\\)\\(:\\([-+~]@?\\|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\|@?\\(\\w\\|_\\)+\\([!?=]\\|\\b_*\\)\\|#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\)\\)" 1844 '("\\(^\\|[^:]\\)\\(:\\([-+~]@?\\|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\|@?\\(\\w\\|_\\)+\\([!?=]\\|\\b_*\\)\\|#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\)\\)"
1805 2 font-lock-constant-face) 1845 2 font-lock-constant-face)