From: Dmitry Gutov Date: Mon, 9 Mar 2015 03:26:57 +0000 (+0200) Subject: ruby-mode: Don't consider `=' a part of symbol when followed by `>' X-Git-Tag: emacs-25.0.90~2564^2~189 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4fab7badf5ce341cd6b1e32e72f55eee5c3962e8;p=emacs.git ruby-mode: Don't consider `=' a part of symbol when followed by `>' Fixes: debbugs:18644 * lisp/progmodes/ruby-mode.el (ruby-font-lock-keywords): Don't consider `=' a part of symbol when followed by `>'. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3e458135186..e1842973acb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2015-03-09 Dmitry Gutov + + * progmodes/ruby-mode.el (ruby-font-lock-keywords): Don't consider + `=' a part of symbol when followed by `>'. (Bug#18644) + 2015-03-09 Eli Zaretskii * dired.el (dired-delete-file): Doc fix. (Bug#20021) diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 4abc413f636..06b1fcf1729 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -2155,8 +2155,16 @@ See `font-lock-syntax-table'.") ;; Keywords that evaluate to certain values. ("\\_<__\\(?:LINE\\|ENCODING\\|FILE\\)__\\_>" (0 font-lock-builtin-face)) - ;; Symbols. - ("\\(^\\|[^:]\\)\\(:\\([-+~]@?\\|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\|@?\\(\\w\\|_\\)+\\([!?=]\\|\\b_*\\)\\|#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\)\\)" + ;; Symbols with symbol characters. + ("\\(^\\|[^:]\\)\\(:@?\\(?:\\w\\|_\\)+\\)\\([!?=]\\)?" + (2 font-lock-constant-face) + (3 (unless (and (eq (char-before (match-end 3)) ?=) + (eq (char-after (match-end 3)) ?>)) + ;; bug#18466 + font-lock-constant-face) + nil t)) + ;; Symbols with special characters. + ("\\(^\\|[^:]\\)\\(:\\([-+~]@?\\|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\|#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\)\\)" 2 font-lock-constant-face) ;; Special globals. (,(concat "\\$\\(?:[:\"!@;,/\\._><\\$?~=*&`'+0-9]\\|-[0adFiIlpvw]\\|"