[前][次][番号順一覧][スレッド一覧]

ruby-changes:4772

From: ko1@a...
Date: Fri, 2 May 2008 15:01:49 +0900 (JST)
Subject: [ruby-changes:4772] matz - Ruby:r16266 (trunk): * misc/ruby-mode.el: move fontifying code from hook.

matz	2008-05-02 15:01:13 +0900 (Fri, 02 May 2008)

  New Revision: 16266

  Modified files:
    trunk/ChangeLog
    trunk/misc/ruby-mode.el

  Log:
    * misc/ruby-mode.el: move fontifying code from hook.
      [ruby-core:16636]

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/misc/ruby-mode.el?r1=16266&r2=16265&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=16266&r2=16265&diff_format=u

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 16265)
+++ ChangeLog	(revision 16266)
@@ -1,3 +1,8 @@
+Fri May  2 14:52:33 2008  Yukihiro Matsumoto  <matz@r...>
+
+	* misc/ruby-mode.el: move fontifying code from hook.
+	  [ruby-core:16636]
+
 Fri May  2 14:10:17 2008  Yukihiro Matsumoto  <matz@r...>
 
 	* range.c (range_step): step may be bignum.
Index: misc/ruby-mode.el
===================================================================
--- misc/ruby-mode.el	(revision 16265)
+++ misc/ruby-mode.el	(revision 16266)
@@ -307,6 +307,11 @@
 	 ((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 @@
 	  ("^\\(=\\)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)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]