[#23884] Ruby 1.8.2 preview1にむけて — matz@... (Yukihiro Matsumoto)

まつもと ゆきひろです

34 messages 2004/07/13
[#23917] Re: Ruby 1.8.2 preview1にむけて — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/07/16

山本です。

[#23920] Re: Ruby 1.8.2 preview1にむけて — "NAKAMURA, Hiroshi" <nakahiro@...> 2004/07/16

なひです。

[#23922] ruby 1.8.2 preview1 — matz@... (Yukihiro Matsumoto)

まつもと ゆきひろです

27 messages 2004/07/16

[#23995] String#each -> String#each_char — Shugo Maeda <shugo@...>

前田です。

27 messages 2004/07/30
[#23996] Re: String#each -> String#each_char — matz@... (Yukihiro Matsumoto) 2004/07/30

まつもと ゆきひろです

[#23997] Re: String#each -> String#each_char — "U.Nakamura" <usa@...> 2004/07/30

こんにちは、なかむら(う)です。

[#23999] Re: String#each -> String#each_char — matz@... (Yukihiro Matsumoto) 2004/07/30

まつもと ゆきひろです

[#24000] Re: String#each -> String#each_char — "U.Nakamura" <usa@...> 2004/07/30

こんにちは、なかむら(う)です。

[#24005] Re: String#each -> String#each_char — Minero Aoki <aamine@...> 2004/07/31

青木です。

[#24012] Re: String#each -> String#each_char — Shugo Maeda <shugo@...> 2004/08/01

前田です。

[#24014] Re: String#each -> String#each_char — Minero Aoki <aamine@...> 2004/08/02

青木です。

[ruby-dev:24002] Re: ruby-mode.el のインデント

From: nobu.nakada@...
Date: 2004-07-31 03:56:23 UTC
List: ruby-dev #24002
なかだです。

At Sat, 31 Jul 2004 01:15:20 +0900,
GOTO Naohisa wrote:
> 例1:
> 
> def aa(b)
>   unless defined?(@b)
> @b = b
> end
> end
> 
> unlessをifにしても同じです。
> defined?の後の括弧を無くすと正常にネストされます。
> 
> 例2:
> 
> unless org
>   org = e.org if e.org
>               end
> 
> 推測ですが、orから始まる変数かメソッドが原因のような気がします。

どちらも原因は同じようですね。


Index: misc/ruby-mode.el
===================================================================
RCS file: /cvs/ruby/src/ruby/misc/ruby-mode.el,v
retrieving revision 1.81
diff -U2 -p -d -r1.81 ruby-mode.el
--- misc/ruby-mode.el	7 May 2004 08:44:24 -0000	1.81
+++ misc/ruby-mode.el	31 Jul 2004 02:39:48 -0000
@@ -322,7 +322,7 @@ The variable ruby-indent-level controls 
 		 (skip-chars-backward ruby-symbol-chars)
 		 (cond
-		  ((or (looking-at ruby-block-beg-re)
-		       (looking-at ruby-block-op-re)
-		       (looking-at ruby-block-mid-re))
+		  ((or (looking-at (concat "\\<\\(" ruby-block-beg-re
+					   "|" ruby-block-op-re
+					   "|" ruby-block-mid-re "\\)\\>")))
 		   (goto-char (match-end 0))
                   (not (looking-at "\\s_")))
@@ -452,5 +452,5 @@ The variable ruby-indent-level controls 
 	(setq nest (cdr nest))
 	(goto-char pnt))
-       ((looking-at ruby-block-end-re)
+       ((looking-at (concat "\\<\\(" ruby-block-end-re "\\)\\>"))
 	(if (or (and (not (bolp))
 		     (progn
@@ -478,5 +478,5 @@ The variable ruby-indent-level controls 
 	      (setq depth (1+ depth))))
 	(goto-char (match-end 0)))
-       ((looking-at ruby-block-beg-re)
+       ((looking-at (concat "\\<\\(" ruby-block-beg-re "\\)\\>"))
 	(and
 	 (save-match-data
@@ -662,5 +662,5 @@ The variable ruby-indent-level controls 
 	   (or (and (looking-at ruby-symbol-re)
 		    (skip-chars-backward ruby-symbol-chars)
-		    (looking-at ruby-block-hanging-re)
+		    (looking-at (concat "\\<\\(" ruby-block-hanging-re "\\)\\>"))
 		    (not (eq (point) (nth 3 state)))
 		    (save-excursion
@@ -701,5 +701,5 @@ The variable ruby-indent-level controls 
 		  ((and
 		    (null op-end)
-		    (not (looking-at ruby-block-hanging-re))
+		    (not (looking-at (concat "\\<\\(" ruby-block-hanging-re "\\)\\>")))
 		    (eq (ruby-deep-indent-paren-p t) 'space)
 		    (not (bobp)))
@@ -758,5 +758,5 @@ An end of a defun is found by moving for
   (let (start pos done down)
     (setq start (ruby-calculate-indent))
-    (setq down (looking-at (if (< n 0) ruby-block-end-re ruby-block-beg-re)))
+    (setq down (looking-at (concat "\\<\\(" (if (< n 0) ruby-block-end-re ruby-block-beg-re) "\\)\\>")))
     (while (and (not done) (not (if (< n 0) (bobp) (eobp))))
       (forward-line n)
@@ -780,5 +780,5 @@ An end of a defun is found by moving for
 	  (save-excursion
 	    (back-to-indentation)
-	    (if (looking-at ruby-block-mid-re)
+	    (if (looking-at (concat ("\\<\\(" ruby-block-mid-re "\\)\\>")))
 		(setq done nil))))))
   (back-to-indentation))
@@ -808,5 +808,5 @@ An end of a defun is found by moving for
 		     (looking-at "\\s("))
 		   (goto-char (scan-sexps (point) 1)))
-		  ((and (looking-at ruby-block-beg-re)
+		  ((and (looking-at (concat "\\<\\(" ruby-block-beg-re "\\)\\>"))
 			(not (eq (char-before (point)) ?.))
 			(not (eq (char-before (point)) ?:)))
@@ -869,5 +869,5 @@ An end of a defun is found by moving for
 				    (forward-char -1)
 				    (eq (char-before) :)))))
-		   (if (looking-at ruby-block-end-re)
+		   (if (looking-at (concat "\\<\\(" ruby-block-end-re "\\)\\>"))
 		       (ruby-beginning-of-block))
 		   nil))


-- 
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
    中田 伸悦

In This Thread