* lisp/progmodes/ruby-mode.el (ruby-smie-rules): Dedent `ensure'
authorDmitry Gutov <dgutov@yandex.ru>
Sun, 6 Oct 2013 00:46:28 +0000 (03:46 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Sun, 6 Oct 2013 00:46:28 +0000 (03:46 +0300)
keyword, too.

* test/indent/ruby.rb: Fix a syntax error, add a few failing examples.

lisp/ChangeLog
lisp/progmodes/ruby-mode.el
test/ChangeLog
test/indent/ruby.rb

index 24011e3..5a49690 100644 (file)
@@ -1,3 +1,8 @@
+2013-10-06  Dmitry Gutov  <dgutov@yandex.ru>
+
+       * progmodes/ruby-mode.el (ruby-smie-rules): Dedent `ensure'
+       keyword, too.
+
 2013-10-05  Dmitry Gutov  <dgutov@yandex.ru>
 
        * newcomment.el (comment-use-global-state): Change default value
index 662cef8..c1f79eb 100644 (file)
@@ -381,7 +381,7 @@ Also ignores spaces after parenthesis when 'space."
                                     (looking-at comment-start-skip)))))
        ;; `(column . ,(smie-indent-virtual))
        (smie-rule-parent)))
-    (`(:before . ,(or `"else" `"then" `"elsif" `"rescue")) 0)
+    (`(:before . ,(or `"else" `"then" `"elsif" `"rescue" `"ensure")) 0)
     (`(:before . ,(or `"when"))
      (if (not (smie-rule-sibling-p)) 0)) ;; ruby-indent-level
     ;; Hack attack: Since newlines are separators, don't try to align args that
index ac98b1c..bc9addb 100644 (file)
@@ -1,3 +1,7 @@
+2013-10-06  Dmitry Gutov  <dgutov@yandex.ru>
+
+       * indent/ruby.rb: Fix a syntax error, add a few failing examples.
+
 2013-10-05  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * indent/ruby.rb: Port a few cases from automated/ruby-mode-tests.el.
index 15315bc..d52f4a3 100644 (file)
@@ -37,7 +37,7 @@ foo = [1,                       # ruby-deep-indent
        2]
 
 foo = {                         # ruby-deep-indent-disabled
-  a : b
+  a: b
 }
 
 foo = [                         # ruby-deep-indent-disabled
@@ -99,6 +99,27 @@ if something == :==
   do_something
 end
 
+begin
+  foo
+ensure
+  bar
+end
+
+# Examples below fail with SMIE.
+
 # Bug#15369
 MSG = 'Separate every 3 digits in the integer portion of a number' \
       'with underscores(_).'
+
+# Next two fail similarly to the one above, so maybe remove 1 or 2
+# after they're fixed:
+
+a = foo(j, k) -
+  bar_tee
+
+while a < b do # "do" is optional
+  foo
+end
+
+desc "foo foo" \
+  "bar bar"