diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-06-09 09:21:37 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-06-09 09:21:37 +0000 |
commit | c1241cd2ed230573bb81b52173d6cd2bd91176f2 (patch) | |
tree | caa3babd9a35b930814fffa9c8ebb3366d46dae8 /misc | |
parent | 17ae11ca25d210da8c7deeeee0f03fd1a09ee0b2 (diff) |
thread bugs
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'misc')
-rw-r--r-- | misc/ruby-mode.el | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el index 46b23be21c..0623e2dec5 100644 --- a/misc/ruby-mode.el +++ b/misc/ruby-mode.el @@ -152,6 +152,15 @@ The variable ruby-indent-level controls the amount of indentation. (setq mode-name "Ruby") (setq major-mode 'ruby-mode) (ruby-mode-variables) + ;; for font-lock + (make-local-variable 'font-lock-syntactic-keywords) + (setq font-lock-syntactic-keywords + '(("\\$\\([#\"'`$\\]\\)" 1 (1 . nil)) + ("\\(#\\)[{$@]" 1 (1 . nil)))) + (make-local-variable 'font-lock-defaults) + (setq font-lock-defaults '((ruby-font-lock-keywords) nil nil)) + (setq font-lock-keywords ruby-font-lock-keywords) + (run-hooks 'ruby-mode-hook)) (defun ruby-current-indentation () @@ -627,8 +636,7 @@ An end of a defun is found by moving forward from the beginning of one." ("\\$\\(.\\|\\sw+\\)" nil type) ("[$@].[a-zA-Z_0-9]*" nil struct) ("^__END__" nil label)))) - - ((featurep 'font-lock) + ) (or (boundp 'font-lock-variable-name-face) (setq font-lock-variable-name-face font-lock-type-face)) (defvar ruby-font-lock-keywords @@ -687,15 +695,5 @@ An end of a defun is found by moving forward from the beginning of one." '("^\\s *def\\s *\\<\\(\\(\\w\\|\\s_\\)+\\.\\)?\\(\\(\\w\\|\\s_\\)+\\)\\>" 3 font-lock-function-name-face t)) "*Additional expressions to highlight in ruby mode.") - (add-hook - 'ruby-mode-hook - (lambda () - (make-local-variable 'font-lock-syntactic-keywords) - (setq font-lock-syntactic-keywords - '(("\\$\\([#\"'`$\\]\\)" 1 (1 . nil)) - ("\\(#\\)[{$@]" 1 (1 . nil)))) - (make-local-variable 'font-lock-defaults) - (setq font-lock-defaults '((ruby-font-lock-keywords) nil nil)) - (setq font-lock-keywords ruby-font-lock-keywords))))) (provide 'ruby-mode) |