diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-03-11 10:05:02 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-03-11 10:05:02 +0000 |
commit | 5fc3a4126c8069ebb370e34a5a5ca3d274586f8c (patch) | |
tree | 57040902f47a28ccfc28a0f524626675595c8684 /misc/ruby-mode.el | |
parent | 949981f6910ca11149d665e73beb92ef7306a141 (diff) |
* misc/README: Add a note about ruby-electric.el.
* misc/ruby-mode.el (ruby-non-block-do-re): Fix
ruby-non-block-do-re. [ruby-core:03719]
* misc/inf-ruby.el: Synchronize the comment section with trunk.
* misc/README, misc/rdebug.el: Add rdebug.el, Emacs ruby-debug
interface based on rubydb3x.el; submitted by Martin Nordholts
<enselic AT gmail.com> in [ruby-bugs:PR#9023].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@12032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'misc/ruby-mode.el')
-rw-r--r-- | misc/ruby-mode.el | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el index c07fdbb536..25c6b3008d 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 "-,.+*/%&|^~=<>:") @@ -383,7 +383,7 @@ The variable ruby-indent-level controls the amount of indentation. (t (setq in-string (point)) (goto-char end)))) - ((looking-at "/=") + ((looking-at "/=") (goto-char pnt)) ((looking-at "/") (cond @@ -454,7 +454,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) @@ -782,7 +782,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 @@ -893,7 +894,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))) |