summaryrefslogtreecommitdiff
path: root/sample/ruby-mode.el
diff options
context:
space:
mode:
authorYukihiro Matsumoto <matz@ruby-lang.org>1995-02-21 18:56:56 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2019-08-17 22:09:31 +0900
commit2f106ab85c4f4e171374aee261f5a12bdd923c41 (patch)
tree6810f0a05ad8df30a269eb522eea5f77186b90c6 /sample/ruby-mode.el
parentc080fb6d10bbcb697b6ba16e640de8db3f1973d0 (diff)
version 0.67v0_67
https://cache.ruby-lang.org/pub/ruby/1.0/ruby-0.66-0.67.diff.gz Tue Feb 21 18:56:56 1995 Yukihiro Matsumoto (matz@ix-02) * io.c(STDIN, STDOUT, STDERR): 定数として定義.今までの$stdinなど は将来なくなるかも知れない. * io.c(select): bug fix. * version 0.67 Mon Feb 20 16:10:14 1995 Yukihiro Matsumoto (matz@ix-02) * parse.y(yylex): 定数を`%識別子'から,第1文字が大文字の識別子に変 更.それにともないクラスは定数となった. * eval.c: クラス定義内のselfがクラス定義外部のthe_classだった. * variable.c(rb_name_class): クラス名をインスタンス変数に格納する. Thu Feb 16 15:36:17 1995 Yukihiro Matsumoto (matz@ix-02) * parse.y: BLOCKをbraceで表現する文法に変更したものを作ってみる. MLに提示してみるが反応がない. * object.c(do,forever): なくした. Wed Feb 15 13:20:49 1995 Yukihiro Matsumoto (matz@ix-02) * re.c(new): 第2引数が与えられて,かつnilでないときだけ設定するよ うに(以前はnilの時にも設定を行なっていた). * parse.y(parse_regexp): 正規表現リテラルで大文字小文字を無視する かどうか指定できるように. Tue Feb 14 00:55:33 1995 Yukihiro Matsumoto (matz@dyna) * parse.y: (compexpr) -> (expr). Fri Feb 10 16:30:00 1995 Yukihiro Matsumoto (matz@ix-02) * ruby.c(load_file): scriptを読み込む時だけ"#!"の解析を行うように. * ruby.c(readin): ファイル読み込み時に先頭に"#!"があり,rubyに引数 が与えられていれば,その引数も有効になる. * parse.y(yylex): コメント行の終りが`\'であった時,次の行に継続し ているとみなすようにした.
Diffstat (limited to 'sample/ruby-mode.el')
-rw-r--r--sample/ruby-mode.el16
1 files changed, 11 insertions, 5 deletions
diff --git a/sample/ruby-mode.el b/sample/ruby-mode.el
index 4396b1098d..20e1abebc9 100644
--- a/sample/ruby-mode.el
+++ b/sample/ruby-mode.el
@@ -8,7 +8,7 @@
;;;
(defconst ruby-block-beg-re
- "class\\|module\\|def\\|if\\|unless\\|case\\|while\\|until\\|for\\|begin"
+ "class\\|module\\|def\\|if\\|case\\|while\\|for\\|begin"
)
(defconst ruby-block-mid-re
@@ -170,10 +170,14 @@ The variable ruby-indent-level controls the amount of indentation.
((or (string= "\"" w) ;skip string
(string= "'" w)
(string= "`" w))
- (if (search-forward w indent-point t)
- nil
+ (cond
+ ((string= w (char-to-string (char-after (point))))
+ (forward-char 1))
+ ((re-search-forward (format "[^\\]%s" w) indent-point t)
+ nil)
+ (t
(goto-char indent-point)
- (setq in-string t)))
+ (setq in-string t))))
((or (string= "/" w)
(string= "<" w))
(if (string= "<" w) (setq w ">"))
@@ -189,7 +193,9 @@ The variable ruby-indent-level controls the amount of indentation.
(and (eq c ?w)
(save-excursion
(forward-word -1)
- (looking-at ruby-block-beg-re))))
+ (or
+ (looking-at ruby-block-beg-re)
+ (looking-at ruby-block-mid-re)))))
(if (search-forward w indent-point t)
nil
(goto-char indent-point)