summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-01-05 04:41:21 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-01-05 04:41:21 +0000
commitde7161526014b781468cea5d84411e23be945f79 (patch)
treece7e90b3c16ce6246be9850c9b1ea1328992c0e7 /misc
parenta1d1b1516750c1047ceb7010f8f5ca34b358c7e3 (diff)
20000105
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'misc')
-rw-r--r--misc/ruby-mode.el23
1 files changed, 10 insertions, 13 deletions
diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el
index 098ddd5..1b7effc 100644
--- a/misc/ruby-mode.el
+++ b/misc/ruby-mode.el
@@ -189,7 +189,7 @@ The variable ruby-indent-level controls the amount of indentation.
(indent-to x)
(move-to-column (+ x shift))))))
-(defun ruby-expr-beg (&optional modifier)
+(defun ruby-expr-beg (&optional option)
(save-excursion
(if (looking-at "\\?")
(progn
@@ -201,15 +201,11 @@ The variable ruby-indent-level controls the amount of indentation.
(or (bolp)
(looking-at ruby-operator-re)
(looking-at "[\\[({]")
- (and (not modifier) (looking-at "[!?]"))
+ (and (not (eq option 'modifier))
+ (looking-at "[!?]"))
(and (looking-at ruby-symbol-re)
- (save-restriction
- (let ((p (point)))
- (beginning-of-line)
- (narrow-to-region (point) p)
- (goto-char p)
- (forward-word -1)))
- (if (and (not modifier) (bolp))
+ (skip-chars-backward ruby-symbol-chars)
+ (if (and (not (eq option 'modifier)) (bolp))
t
(if (or (looking-at ruby-block-beg-re)
(looking-at ruby-block-op-re)
@@ -217,7 +213,8 @@ The variable ruby-indent-level controls the amount of indentation.
(progn
(goto-char (match-end 0))
(looking-at "\\>"))
- (looking-at "[a-zA-Z][a-zA-z0-9_]* +/[^ \t]"))))))))
+ (and (not (eq option 'expr-arg))
+ (looking-at "[a-zA-Z][a-zA-z0-9_]* +/[^ \t]")))))))))
(defun ruby-parse-region (start end)
(let ((indent-point end)
@@ -252,7 +249,7 @@ The variable ruby-indent-level controls the amount of indentation.
(goto-char indent-point))))
((looking-at "/")
(cond
- ((and (not (eobp)) (ruby-expr-beg))
+ ((and (not (eobp)) (ruby-expr-beg 'expr-arg))
(if (re-search-forward "[^\\]/" indent-point t)
nil
(setq in-string (point))
@@ -261,7 +258,7 @@ The variable ruby-indent-level controls the amount of indentation.
(goto-char pnt))))
((looking-at "%")
(cond
- ((and (not (eobp)) (ruby-expr-beg)
+ ((and (not (eobp)) (ruby-expr-beg 'expr-arg)
(not (looking-at "%="))
(looking-at "%[Qqrxw]?\\(.\\)"))
(setq w (buffer-substring (match-beginning 1)
@@ -352,7 +349,7 @@ The variable ruby-indent-level controls the amount of indentation.
(progn
(goto-char (match-beginning 0))
(if (looking-at ruby-modifier-re)
- (ruby-expr-beg t)
+ (ruby-expr-beg 'modifier)
t))
t)
(goto-char pnt)