From: Dmitry Gutov Date: Sun, 6 Oct 2013 00:46:28 +0000 (+0300) Subject: * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Dedent `ensure' X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1374 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5cd9cda9b61159051825a2c5ae2700bf280e2cf2;p=emacs.git * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Dedent `ensure' keyword, too. * test/indent/ruby.rb: Fix a syntax error, add a few failing examples. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 24011e3584c..5a496908af7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-10-06 Dmitry Gutov + + * progmodes/ruby-mode.el (ruby-smie-rules): Dedent `ensure' + keyword, too. + 2013-10-05 Dmitry Gutov * newcomment.el (comment-use-global-state): Change default value diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 662cef82259..c1f79eb8711 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -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 diff --git a/test/ChangeLog b/test/ChangeLog index ac98b1c3040..bc9addb810b 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2013-10-06 Dmitry Gutov + + * indent/ruby.rb: Fix a syntax error, add a few failing examples. + 2013-10-05 Stefan Monnier * indent/ruby.rb: Port a few cases from automated/ruby-mode-tests.el. diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb index 15315bcf653..d52f4a3e6f6 100644 --- a/test/indent/ruby.rb +++ b/test/indent/ruby.rb @@ -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"