summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Gutov <dgutov@yandex.ru>2013-10-24 04:47:28 +0400
committerDmitry Gutov <dgutov@yandex.ru>2013-10-24 04:47:28 +0400
commit369bbf7198fa5dfdac366f9e5f79b84d9c72f3ee (patch)
tree221c2c04712e50f4bc7bba5b15798b4864375c03
parent9843415589b51e6360e5428636b0f2fcc88e9c5b (diff)
* 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.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/progmodes/ruby-mode.el6
-rw-r--r--test/ChangeLog4
-rw-r--r--test/indent/ruby.rb2
4 files changed, 13 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 926bd1091c0..cc302daa9cf 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -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)
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 88820a4a942..5f553b94ba7 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -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)
diff --git a/test/ChangeLog b/test/ChangeLog
index 358ef31b1bb..c392b792142 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -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):
diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb
index 7601738dc76..1fd19cf34d4 100644
--- a/test/indent/ruby.rb
+++ b/test/indent/ruby.rb
@@ -40,7 +40,7 @@ foo = { # ruby-deep-indent-disabled
a: b
}
-foo = { a: b
+foo = { a: b,
a1: b1
}