* lisp/progmodes/ruby-mode.el (ruby-smie-rules): Fix the "curly block

with parameters" example.  Simplify the "is it block or is it
hash" check, but also make it more thorough.

* test/indent/ruby.rb: Fix syntax error in the latest example.
This commit is contained in:
Dmitry Gutov 2013-10-24 04:47:28 +04:00
parent 9843415589
commit 369bbf7198
4 changed files with 13 additions and 5 deletions

View file

@ -1,3 +1,9 @@
2013-10-24 Dmitry Gutov <dgutov@yandex.ru>
* progmodes/ruby-mode.el (ruby-smie-rules): Fix the "curly block
with parameters" example. Simplify the "is it block or is it
hash" check, but also make it more thorough.
2013-10-23 Masashi Fujimoto <masfj.dev@gmail.com> (tiny change)
* battery.el (battery-pmset): Handle OS X Mavericks. (Bug#15694)

View file

@ -449,7 +449,7 @@ explicitly declared in magic comment."
((smie-rule-parent-p "def" "begin" "do" "class" "module" "for"
"while" "until" "unless"
"if" "then" "elsif" "else" "when"
"rescue" "ensure")
"rescue" "ensure" "{")
(smie-rule-parent ruby-indent-level))
;; For (invalid) code between switch and case.
;; (if (smie-parent-p "switch") 4)
@ -457,9 +457,7 @@ explicitly declared in magic comment."
(`(:before . ,(or `"(" `"[" `"{"))
(cond
((and (equal token "{")
(not (smie-rule-prev-p "(" "{" "[" "," "=>"))
(or (smie-rule-hanging-p)
(smie-rule-next-p "opening-|")))
(not (smie-rule-prev-p "(" "{" "[" "," "=>" "=" "return" ";")))
;; Curly block opener.
(smie-rule-parent))
((smie-rule-hanging-p)

View file

@ -1,3 +1,7 @@
2013-10-24 Dmitry Gutov <dgutov@yandex.ru>
* indent/ruby.rb: Fix syntax error in the latest example.
2013-10-23 Glenn Morris <rgm@gnu.org>
* automated/Makefile.in (abs_top_srcdir, top_builddir):

View file

@ -40,7 +40,7 @@
a: b
}
foo = { a: b
foo = { a: b,
a1: b1
}