* lisp/progmodes/ruby-mode.el (ruby-toggle-block): Guess the current block,
authorDmitry Gutov <dgutov@yandex.ru>
Sat, 8 Sep 2012 23:32:25 +0000 (03:32 +0400)
committerDmitry Gutov <dgutov@yandex.ru>
Sat, 8 Sep 2012 23:32:25 +0000 (03:32 +0400)
commitc3268831411fd68ce4f6f84ecda5eda2814a59a8
tree73bf19e8bfbead6b975c923d0df4d7d44ae4a7bf
parent9d7f18633a3f36de96bb42d856355c5ce12f2b5d
* lisp/progmodes/ruby-mode.el (ruby-toggle-block): Guess the current block,
not just expect to be at its beginning.  Adjust callees.
Succeed when do-end block has no space before the pipe character.
(ruby-brace-to-do-end): When the original block is one-liner,
convert to multiline.  Reindent the result.

* test/automated/ruby-mode-tests.el:
(ruby-toggle-block-to-multiline): New test.
(ruby-should-indent-buffer, ruby-toggle-block-to-do-end)
(ruby-toggle-block-to-brace): Use buffer-string.
lisp/ChangeLog
lisp/progmodes/ruby-mode.el
test/ChangeLog
test/automated/ruby-mode-tests.el