diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-03-11 15:34:49 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-03-11 15:34:49 +0000 |
commit | 35df73cfa739edffea41ec6d355961f8bf569dbd (patch) | |
tree | 3232a3a51dcccd812e96d71bcc584682d252ba14 /misc/ruby-mode.el | |
parent | 5952769bd377315f6124d5812ee7e161b1da1283 (diff) |
* merge -c 12031
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_5@12035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'misc/ruby-mode.el')
-rw-r--r-- | misc/ruby-mode.el | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el index d51e8c9425..21e1b4664c 100644 --- a/misc/ruby-mode.el +++ b/misc/ruby-mode.el @@ -18,7 +18,7 @@ ) (defconst ruby-non-block-do-re - "\\(while\\|until\\|for\\|rescue\\)\\>" + "\\(while\\|until\\|for\\|rescue\\)\\>[^_]" ) (defconst ruby-indent-beg-re @@ -45,7 +45,7 @@ (concat ruby-modifier-beg-re "\\|" ruby-block-op-re) ) -(defconst ruby-block-end-re "end") +(defconst ruby-block-end-re "\\<end\\>") (defconst ruby-here-doc-beg-re "<<\\(-\\)?\\(\\([a-zA-Z0-9_]+\\)\\|[\"]\\([^\"]+\\)[\"]\\|[']\\([^']+\\)[']\\)") @@ -61,13 +61,13 @@ (defconst ruby-delimiter (concat "[?$/%(){}#\"'`.:]\\|<<\\|\\[\\|\\]\\|\\<\\(" ruby-block-beg-re - "\\|" ruby-block-end-re - "\\)\\>\\|^=begin\\|" ruby-here-doc-beg-re) + "\\)\\>\\|" ruby-block-end-re + "\\|^=begin\\|" ruby-here-doc-beg-re) ) (defconst ruby-negative - (concat "^[ \t]*\\(\\(" ruby-block-mid-re "\\)\\>\\|\\(" - ruby-block-end-re "\\)\\>\\|}\\|\\]\\)") + (concat "^[ \t]*\\(\\(" ruby-block-mid-re "\\)\\>\\|" + ruby-block-end-re "\\|}\\|\\]\\)") ) (defconst ruby-operator-chars "-,.+*/%&|^~=<>:") @@ -452,7 +452,7 @@ The variable ruby-indent-level controls the amount of indentation. (setq depth (1- depth))) (setq nest (cdr nest)) (goto-char pnt)) - ((looking-at (concat "\\<\\(" ruby-block-end-re "\\)\\>")) + ((looking-at ruby-block-end-re) (if (or (and (not (bolp)) (progn (forward-char -1) @@ -780,7 +780,8 @@ An end of a defun is found by moving forward from the beginning of one." (defun ruby-move-to-block (n) (let (start pos done down) (setq start (ruby-calculate-indent)) - (setq down (looking-at (concat "\\<\\(" (if (< n 0) ruby-block-end-re ruby-block-beg-re) "\\)\\>"))) + (setq down (looking-at (if (< n 0) ruby-block-end-re + (concat "\\<\\(" ruby-block-beg-re "\\)\\>")))) (while (and (not done) (not (if (< n 0) (bobp) (eobp)))) (forward-line n) (cond @@ -891,7 +892,7 @@ An end of a defun is found by moving forward from the beginning of one." (?: (forward-char -1) (eq (char-before) :))))) - (if (looking-at (concat "\\<\\(" ruby-block-end-re "\\)\\>")) + (if (looking-at ruby-block-end-re) (ruby-beginning-of-block)) nil)) (setq i (1- i))) |