From 54a04074256fa85db5da3bf0041773ddc3391196 Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 3 Mar 2004 04:55:35 +0000 Subject: * eval.c (method_hash): new method. [ruby-talk:93968] * eval.c (proc_eq): do not compare dyna_vars. * eval.c (proc_hash): new method. * eval.c (rb_yield_0): protect break/return from within orphan (or lambda) Proc object. * parse.y (yylex): should not allow symbol for invalid global variable (e.g. `:$-)`). [ruby-core:02518] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- misc/ruby-mode.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'misc/ruby-mode.el') diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el index a52b00893d..dac90ee1a2 100644 --- a/misc/ruby-mode.el +++ b/misc/ruby-mode.el @@ -561,8 +561,10 @@ The variable ruby-indent-level controls the amount of indentation. (defun ruby-indent-size (pos nest) (+ pos (* (or nest 1) ruby-indent-level))) +;;; maybe obsolete (defconst ruby-assign-re "\\s *\\(&&\\|||\\|<<\\|>>\\|[-+*/%&|^]\\)?=\\s *") +;;; maybe obsolete (defun ruby-beginning-of-arg (start end) (save-restriction (narrow-to-region start (1+ end)) @@ -586,6 +588,7 @@ The variable ruby-indent-level controls the amount of indentation. (if beg (setq beg nil arg (point)))) ((looking-at ruby-operator-re) (goto-char (match-end 0)) + (echo "foo %s %s" arg beg) (if beg (setq beg nil arg (match-end 0)))) ((not (eq (char-syntax (char-after)) ?\()) (setq start (point))))) @@ -731,7 +734,9 @@ The variable ruby-indent-level controls the amount of indentation. (not (bobp))) (save-excursion (widen) - (ruby-beginning-of-arg (or begin parse-start) (point)) + (goto-char (or begin parse-start)) + (skip-syntax-forward " ") +;; (ruby-beginning-of-arg (or begin parse-start) (point)) (current-column))) (t (+ indent ruby-indent-level)))))))) @@ -832,7 +837,9 @@ An end of a defun is found by moving forward from the beginning of one." (skip-chars-forward ",.:;|&^~=!?\\+\\-\\*") (looking-at "\\s(")) (goto-char (scan-sexps (point) 1))) - ((looking-at ruby-block-beg-re) + ((and (looking-at ruby-block-beg-re) + (not (eq (char-before (point)) ?.)) + (not (eq (char-before (point)) ?:))) (ruby-end-of-block) (forward-word 1)) ((looking-at "\\(\\$\\|@@?\\)?\\sw") -- cgit v1.2.3