From: Dmitry Gutov Date: Sun, 22 Dec 2013 02:31:21 +0000 (+0200) Subject: * lisp/progmodes/ruby-mode.el (ruby-align-to-stmt-keywords): Tweak the X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~260 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=65a1da00fe2fd74416678d47616ca3e5a68087d5;p=emacs.git * lisp/progmodes/ruby-mode.el (ruby-align-to-stmt-keywords): Tweak the docstring. (ruby-smie-rules): Indent plus one level after `=>'. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ddb632edcf9..36877e3dbbe 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2013-12-22 Dmitry Gutov + + * progmodes/ruby-mode.el (ruby-align-to-stmt-keywords): Tweak the + docstring. + (ruby-smie-rules): Indent plus one level after `=>'. + 2013-12-21 Richard Stallman * simple.el (newline): Doc fix. diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 12fb8d2bf72..fae7ce1f8e6 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -227,7 +227,8 @@ This should only be called after matching against `ruby-here-doc-beg-re'." :safe 'integerp) (defcustom ruby-align-to-stmt-keywords nil - "Keywords to align their expression body to statement. + "Keywords after which we align the expression body to statement. + When nil, an expression that begins with one these keywords is indented to the column of the keyword. Example: @@ -614,6 +615,7 @@ It is used when `ruby-encoding-magic-comment-style' is set to `custom'." (cons 'column (current-column))))) (`(:before . "do") (ruby-smie--indent-to-stmt)) (`(:before . ".") ruby-indent-level) + (`(:after . "=>") ruby-indent-level) (`(:before . ,(or `"else" `"then" `"elsif" `"rescue" `"ensure")) (smie-rule-parent)) (`(:before . "when") diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb index 7a1a225834d..011b59a195f 100644 --- a/test/indent/ruby.rb +++ b/test/indent/ruby.rb @@ -344,3 +344,9 @@ zoo.keep.bar!( zoo .lose( q, p) + +foo(bar: + tee) + +foo(:bar => + tee)