[#9445] thread.rb — m_seki@...

18 messages 2000/03/16
[#9446] Re: thread.rb — matz@... (Yukihiro Matsumoto) 2000/03/17

[#9460] Re: thread.rb — m_seki@... 2000/03/21

[#9462] Re: thread.rb — matz@... (Yukihiro Matsumoto) 2000/03/21

まつもと ゆきひろです

[#11281] Re: thread.rb — Masatoshi SEKI <m_seki@...> 2000/10/22

[#9498] timeout しない timeout — ARIMA Yasuhiro <fit0298@...>

有馬です。

20 messages 2000/03/26
[#9506] Re: timeout しない timeout — matz@... (Yukihiro Matsumoto) 2000/03/27

まつもと ゆきひろです

[#9509] Re: timeout しない timeout — gotoken@... (GOTO Kentaro) 2000/03/27

In message "[ruby-dev:9506] Re: timeout しない timeout"

[ruby-dev:9370] [PATCH] ruby-mode.el

From: nobu.nakada@...
Date: 2000-03-05 10:36:54 UTC
List: ruby-dev #9370
なかだです。

  この間 MatchData#begin とか使ったらインデントがみょーな感じなっ
たのと、=begin RD ... =end もコメントとみなして欲しいなってのでパッ
チです。あと yield と最後に改行が無いときにもハイライトするように
してみました。


Sun Mar  5 18:49:06 2000  Nakada.Nobuyoshi  <nobu.nokada@softhome.net>

	* misc/ruby-mode.el (ruby-parse-region): not treat method `begin'
	  and `end' as reserved words.

	* misc/ruby-mode.el (ruby-font-lock-docs): ignore after `=begin'
	  and `=end'.

	* misc/ruby-mode.el (ruby-font-lock-keywords, hilit-set-mode-patterns):
	  added `yield' to keywords.

	* misc/ruby-mode.el (ruby-font-lock-keywords, hilit-set-mode-patterns):
	  matches keywords at end of buffer.

--- misc/ruby-mode.el	2000/02/08 13:00:01	1.11
+++ misc/ruby-mode.el	2000/03/05 10:13:11
@@ -314,7 +314,9 @@
 		(if (or (and (not (bolp))
 			     (progn
 			       (forward-char -1)
-			       (eq ?_ (char-after (point)))))
+			       (setq w (char-after (point)))
+			       (or (eq ?_ w)
+				   (eq ?. w))))
 			(progn
 			  (goto-char pnt)
 			  (setq w (char-after (point)))
@@ -339,7 +341,9 @@
 		 (or (bolp)
 		     (progn
 		       (forward-char -1)
-		       (not (eq ?_ (char-after (point))))))
+		       (setq w (char-after (point)))
+		       (not (or (eq ?_ w)
+				(eq ?. w)))))
 		 (goto-char pnt)
 		 (setq w (char-after (point)))
 		 (not (eq ?_ w))
@@ -622,12 +626,12 @@
 	       (setq font-lock-keywords ruby-font-lock-keywords)))
 
   (defun ruby-font-lock-docs (limit)
-    (if (re-search-forward "^=begin\\s *$" limit t)
+    (if (re-search-forward "^=begin\\(\\s \\|$\\)" limit t)
 	(let (beg)
 	  (beginning-of-line)
 	  (setq beg (point))
 	  (forward-line 1)
-	  (if (re-search-forward "^=end\\s *$" limit t)
+	  (if (re-search-forward "^=end\\(\\s \\|$\\)" limit t)
 	      (progn
 		(set-match-data (list beg (point)))
 		t)))))
@@ -672,12 +676,13 @@
 	       "until"
 	       "when"
 	       "while"
+	       "yield"
 	       )
 	     "\\|")
-	    "\\)\\>[^_]")
+	    "\\)\\>\\([^_]\\|$\\)")
 	   2)
      ;; variables
-     '("\\(^\\|[^_:.@$]\\|\\.\\.\\)\\b\\(nil\\|self\\|true\\|false\\)\\b[^_]"
+     '("\\(^\\|[^_:.@$]\\|\\.\\.\\)\\b\\(nil\\|self\\|true\\|false\\)\\b\\([^_]\\|$\\)"
        2 font-lock-variable-name-face)
      ;; variables
      '("[$@].\\(\\w\\|_\\)*"
@@ -708,8 +713,8 @@
      ("^\\s *\\(require\\|load\\).*$" nil include)
      ("^\\s *\\(include\\|alias\\|undef\\).*$" nil decl)
      ("^\\s *\\<\\(class\\|def\\|module\\)\\>" "[)\n;]" defun)
-     ("[^_]\\<\\(begin\\|case\\|else\\|elsif\\|end\\|ensure\\|for\\|if\\|unless\\|rescue\\|then\\|when\\|while\\|until\\|do\\)\\>[^_]" 1 defun)
-     ("[^_]\\<\\(and\\|break\\|next\\|raise\\|fail\\|in\\|not\\|or\\|redo\\|retry\\|return\\|super\\|yield\\|catch\\|throw\\|self\\|nil\\)\\>[^_]" 1 keyword)
+     ("[^_]\\<\\(begin\\|case\\|else\\|elsif\\|end\\|ensure\\|for\\|if\\|unless\\|rescue\\|then\\|when\\|while\\|until\\|do\\|yield\\)\\>\\([^_]\\|$\\)" 1 defun)
+     ("[^_]\\<\\(and\\|break\\|next\\|raise\\|fail\\|in\\|not\\|or\\|redo\\|retry\\|return\\|super\\|yield\\|catch\\|throw\\|self\\|nil\\)\\>\\([^_]\\|$\\)" 1 keyword)
      ("\\$\\(.\\|\\sw+\\)" nil type)
      ("[$@].[a-zA-Z_0-9]*" nil struct)
      ("^__END__" nil label))))

In This Thread

Prev Next