* misc/ruby-mode.el: move fontifying code from hook.

[ruby-core:16636]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-05-02 06:01:13 +00:00
Родитель 494f6fcfcf
Коммит f145325797
2 изменённых файлов: 17 добавлений и 18 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Fri May 2 14:52:33 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* misc/ruby-mode.el: move fontifying code from hook.
[ruby-core:16636]
Fri May 2 14:10:17 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* range.c (range_step): step may be bignum.

Просмотреть файл

@ -307,6 +307,11 @@ The variable ruby-indent-level controls the amount of indentation.
((boundp 'write-contents-hooks) 'write-contents-hooks))
'ruby-mode-set-encoding)
(set (make-local-variable 'font-lock-defaults) '((ruby-font-lock-keywords) nil nil))
(set (make-local-variable 'font-lock-keywords) ruby-font-lock-keywords)
(set (make-local-variable 'font-lock-syntax-table) ruby-font-lock-syntax-table)
(set (make-local-variable 'font-lock-syntactic-keywords) ruby-font-lock-syntactic-keywords)
(run-mode-hooks 'ruby-mode-hook))
(defun ruby-current-indentation ()
@ -1101,24 +1106,13 @@ balanced expression is found."
("^\\(=\\)begin\\(\\s \\|$\\)" 1 (7 . nil))
("^\\(=\\)end\\(\\s \\|$\\)" 1 (7 . nil))))
(cond ((featurep 'xemacs)
(put 'ruby-mode 'font-lock-defaults
'((ruby-font-lock-keywords)
nil nil nil
beginning-of-line
(font-lock-syntactic-keywords
. ruby-font-lock-syntactic-keywords))))
(t
(add-hook 'ruby-mode-hook
'(lambda ()
(make-local-variable 'font-lock-defaults)
(make-local-variable 'font-lock-keywords)
(make-local-variable 'font-lock-syntax-table)
(make-local-variable 'font-lock-syntactic-keywords)
(setq font-lock-defaults '((ruby-font-lock-keywords) nil nil))
(setq font-lock-keywords ruby-font-lock-keywords)
(setq font-lock-syntax-table ruby-font-lock-syntax-table)
(setq font-lock-syntactic-keywords ruby-font-lock-syntactic-keywords)))))
(if (featurep 'xemacs)
(put 'ruby-mode 'font-lock-defaults
'((ruby-font-lock-keywords)
nil nil nil
beginning-of-line
(font-lock-syntactic-keywords
. ruby-font-lock-syntactic-keywords))))
(defun ruby-font-lock-docs (limit)
(if (re-search-forward "^=begin\\(\\s \\|$\\)" limit t)