summaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-01-04 14:15:33 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-01-04 14:15:33 +0000
commit84ae1c61b40667e4cc5197a14c5f57a43ffc2820 (patch)
tree01f71e4415d55f655c744e1c2289219e46e038d6 /misc
parent73c368eee57e9b1954a9229567d2ca45864781f7 (diff)
downloadruby-84ae1c61b40667e4cc5197a14c5f57a43ffc2820.tar.gz
ruby-84ae1c61b40667e4cc5197a14c5f57a43ffc2820.tar.xz
ruby-84ae1c61b40667e4cc5197a14c5f57a43ffc2820.zip
* process.c (rb_f_system): abandon vfork.
* io.c (pipe_open): ditto. * defines.h: sparc linux needs different FLUSH_REGISTER_WINDOWS * regex.c (re_search): abandon stclass optimization. * bignum.c (rb_cstr2inum): deny "0_". * bignum.c (rb_cstr2inum): allow "0\n" and so on. * error.c (rb_invalid_str): utility function to show inspect()'ed string. * bignum.c (rb_cstr2inum): prints invalid strings in inspect()'ed format. * object.c (rb_Float): ditto. * object.c (rb_convert_type): no longer use rb_rescue(). * re.c (rb_reg_search): initialize taint status of match object. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'misc')
-rw-r--r--misc/ruby-mode.el34
1 files changed, 22 insertions, 12 deletions
diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el
index 09df43dff..a3bd3bea9 100644
--- a/misc/ruby-mode.el
+++ b/misc/ruby-mode.el
@@ -270,7 +270,7 @@ The variable ruby-indent-level controls the amount of indentation.
(while (and (> indent-point (point))
(re-search-forward ruby-delimiter indent-point t))
(or depth (setq depth 0))
- (let ((pnt (point)) w)
+ (let ((pnt (point)) w re)
(goto-char (match-beginning 0))
(cond
((or (looking-at "\"") ;skip string
@@ -302,17 +302,27 @@ The variable ruby-indent-level controls the amount of indentation.
(setq w (buffer-substring (match-beginning 1)
(match-end 1)))
(cond
- ((string= w "[") (setq w "\\]"))
- ((string= w "{") (setq w "}"))
- ((string= w "(") (setq w ")"))
- ((string= w "<") (setq w ">"))
+ ((string= w "[") (setq re "]["))
+ ((string= w "{") (setq re "}{"))
+ ((string= w "(") (setq re ")("))
+ ((string= w "<") (setq re "><"))
((member w '("*" "." "+" "?" "^" "$"))
(setq w (concat "\\" w))))
- (if (re-search-forward
- (if (string= w "\\")
- "\\\\[^\\]*\\\\"
- (concat "[^\\]\\(\\\\\\\\\\)*" w))
- indent-point t)
+ (if (if re
+ (let ((n 1))
+ (setq re (concat "[^\\]\\(\\\\\\\\\\)*[" re "]"))
+ (while (and (re-search-forward re indent-point t)
+ (> (setq n (if (eq (char-before (point))
+ (string-to-char w))
+ (1+ n) (1- n)))
+ 0))
+ (forward-char -1))
+ (zerop n))
+ (re-search-forward
+ (if (string= w "\\")
+ "\\\\[^\\]*\\\\"
+ (concat "[^\\]\\(\\\\\\\\\\)*" w))
+ indent-point t))
nil
(setq in-string (point))
(goto-char indent-point)))
@@ -674,8 +684,8 @@ An end of a defun is found by moving forward from the beginning of one."
(add-hook 'ruby-mode-hook
'(lambda ()
- (make-local-variable 'font-lock-syntactic-keywords)
- (setq font-lock-syntactic-keywords
+ (make-local-variable 'ruby-font-lock-syntactic-keywords)
+ (setq ruby-font-lock-syntactic-keywords
'(
;; #{ }, #$hoge, #@foo are not comments
("\\(#\\)[{$@]" 1 (1 . nil))
OSZAR »