* lisp/progmodes/ruby-mode.el (ruby-indent-beg-re): Only allow "class",
authorDmitry Gutov <dgutov@yandex.ru>
Wed, 26 Dec 2012 16:45:19 +0000 (20:45 +0400)
committerDmitry Gutov <dgutov@yandex.ru>
Wed, 26 Dec 2012 16:45:19 +0000 (20:45 +0400)
  "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.

lisp/ChangeLog
lisp/progmodes/ruby-mode.el
test/ChangeLog
test/automated/ruby-mode-tests.el

index b5fa2e8..f7664b6 100644 (file)
@@ -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).
index 41a9aae..4d50eec 100644 (file)
@@ -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
index 72b4474..7344d8d 100644 (file)
@@ -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):
index 8da0041..28c2a2a 100644 (file)
@@ -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")