From 499572e4d5ddd2ef4dd04e2f234205daed501b08 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Mon, 28 Jan 2013 02:32:11 +0400 Subject: [PATCH] * progmodes/ruby-mode.el (ruby-font-lock-keywords): Use "\\_<" instead of "\\b". Remove some checks made superfluous as a result. --- lisp/ChangeLog | 10 ++++++++++ lisp/progmodes/ruby-mode.el | 8 ++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 610a237b050..cc30dc82341 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,13 @@ +2013-01-27 Dmitry Gutov + + * progmodes/ruby-mode.el (ruby-font-lock-keywords): Remove some + checks made superfluous by the \_< operator. + +2013-01-27 Nobuyoshi Nakada + + * progmodes/ruby-mode.el (ruby-font-lock-keywords): Use "\\_<" + instead of "\\b". + 2013-01-27 Michael Albinus * autorevert.el (auto-revert-handler): Notifications which result diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index a42a66dfa87..989c00365a0 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -1552,7 +1552,7 @@ See `font-lock-syntax-table'.") 1 font-lock-function-name-face) ;; keywords (cons (concat - "\\(^\\|[^_:.@$]\\|\\.\\.\\)\\b\\(defined\\?\\|" + "\\(^\\|[^.@$]\\|\\.\\.\\)\\_<\\(defined\\?\\|" (regexp-opt '("alias_method" "alias" @@ -1602,7 +1602,7 @@ See `font-lock-syntax-table'.") `(,ruby-here-doc-beg-re 0 (unless (ruby-singleton-class-p (match-beginning 0)) 'font-lock-string-face)) ;; variables - '("\\(^\\|[^_:.@$]\\|\\.\\.\\)\\b\\(nil\\|self\\|true\\|false\\)\\>" + '("\\(^\\|[^.@$]\\|\\.\\.\\)\\_<\\(nil\\|self\\|true\\|false\\)\\>" 2 font-lock-variable-name-face) ;; symbols '("\\(^\\|[^:]\\)\\(:\\([-+~]@?\\|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\|@?\\(\\w\\|_\\)+\\([!?=]\\|\\b_*\\)\\|#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\)\\)" @@ -1613,8 +1613,8 @@ See `font-lock-syntax-table'.") '("\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+" 0 font-lock-variable-name-face) ;; constants - '("\\(^\\|[^_]\\)\\b\\([A-Z]+\\(\\w\\|_\\)*\\)" - 2 font-lock-type-face) + '("\\_<\\([A-Z]+\\(\\w\\|_\\)*\\)" + 1 font-lock-type-face) '("\\(^\\s *\\|[\[\{\(,]\\s *\\|\\sw\\s +\\)\\(\\(\\sw\\|_\\)+\\):[^:]" 2 font-lock-constant-face) ;; expression expansion '(ruby-match-expression-expansion -- 2.39.2