diff options
author | Dmitry Gutov <dgutov@yandex.ru> | 2012-12-26 20:45:19 +0400 |
---|---|---|
committer | Dmitry Gutov <dgutov@yandex.ru> | 2012-12-26 20:45:19 +0400 |
commit | db590ef6e30d0b962e226ce5c5a003cc52a17953 (patch) | |
tree | c781d2e3e1513a1b2cac43be94b08eb7c2a99e35 | |
parent | f5c81c80c109fcaca04b25e08c34848110e2550b (diff) | |
download | emacs-db590ef6e30d0b962e226ce5c5a003cc52a17953.tar.gz |
* lisp/progmodes/ruby-mode.el (ruby-indent-beg-re): Only allow "class",
"module" and "def" to have indentation before them. Regression
from 2012-09-07T04:15:56Z!dgutov@yandex.ru (see the new test).
* test/automated/ruby-mode-tests.el
(ruby-indent-after-block-in-continued-expression): New test.
-rw-r--r-- | lisp/ChangeLog | 6 | ||||
-rw-r--r-- | lisp/progmodes/ruby-mode.el | 5 | ||||
-rw-r--r-- | test/ChangeLog | 5 | ||||
-rw-r--r-- | test/automated/ruby-mode-tests.el | 13 |
4 files changed, 27 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b5fa2e85fae..f7664b663ac 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2012-12-26 Dmitry Gutov <dgutov@yandex.ru> + + * progmodes/ruby-mode.el (ruby-indent-beg-re): Only allow "class", + "module" and "def" to have indentation before them. Regression + from 109911 (see the new test). + 2012-12-24 Dmitry Gutov <dgutov@yandex.ru> * progmodes/ruby-mode.el: Bump the version to 1.2 (Bug#13200). diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 41a9aaed6f9..4d50eec6d5e 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -64,8 +64,9 @@ "Regexp to match keywords that nest without blocks.") (defconst ruby-indent-beg-re - (concat "^\\s *" (regexp-opt '("class" "module" "def" "if" "unless" "case" - "while" "until" "for" "begin")) "\\_>") + (concat "^\\(\\s *" (regexp-opt '("class" "module" "def")) "\\|" + (regexp-opt '("if" "unless" "case" "while" "until" "for" "begin")) + "\\)\\_>") "Regexp to match where the indentation gets deeper.") (defconst ruby-modifier-beg-keywords diff --git a/test/ChangeLog b/test/ChangeLog index 72b44747bac..7344d8dfb95 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2012-12-26 Dmitry Gutov <dgutov@yandex.ru> + + * automated/ruby-mode-tests.el + (ruby-indent-after-block-in-continued-expression): New test. + 2012-10-14 Eli Zaretskii <eliz@gnu.org> * automated/compile-tests.el (compile-tests--test-regexps-data): diff --git a/test/automated/ruby-mode-tests.el b/test/automated/ruby-mode-tests.el index 8da0041e9a4..28c2a2a070d 100644 --- a/test/automated/ruby-mode-tests.el +++ b/test/automated/ruby-mode-tests.el @@ -202,6 +202,19 @@ VALUES-PLIST is a list with alternating index and value elements." | end |")) +(ert-deftest ruby-indent-after-block-in-continued-expression () + (ruby-should-indent-buffer + "var = + | begin + | val + | end + |statement" + "var = + |begin + |val + |end + |statement")) + (ert-deftest ruby-move-to-block-stops-at-indentation () (with-temp-buffer (insert "def f\nend") |