From: Dmitry Gutov Date: Sun, 27 Jan 2013 22:32:11 +0000 (+0400) Subject: * progmodes/ruby-mode.el (ruby-font-lock-keywords): Use "\\_<" instead X-Git-Tag: emacs-24.3.90~173^2~7^2~212 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=499572e4d5ddd2ef4dd04e2f234205daed501b08;p=emacs.git * progmodes/ruby-mode.el (ruby-font-lock-keywords): Use "\\_<" instead of "\\b". Remove some checks made superfluous as a result. --- 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