]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/progmodes/ruby-mode.el (ruby-smie-rules): Fix the "curly block
authorDmitry Gutov <dgutov@yandex.ru>
Thu, 24 Oct 2013 00:47:28 +0000 (04:47 +0400)
committerDmitry Gutov <dgutov@yandex.ru>
Thu, 24 Oct 2013 00:47:28 +0000 (04:47 +0400)
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.

lisp/ChangeLog
lisp/progmodes/ruby-mode.el
test/ChangeLog
test/indent/ruby.rb

index 926bd1091c0a5d02954aff9f27c5d3103c40c576..cc302daa9cfc88b8ac1caef742c700567e2696f5 100644 (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)
index 88820a4a94268b74cfbd982533453015dfbf0f5a..5f553b94ba7275c86993c3940a69c0d4d6cb6a57 100644 (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)
index 358ef31b1bb4322693bac43cf81b46edb64a026a..c392b792142f3063e1d1971779020fe9cc04e8dd 100644 (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):
index 7601738dc76a839289b5b224a9ccf56d9736ca30..1fd19cf34d439eb609b4e3d6a52970effc778393 100644 (file)
@@ -40,7 +40,7 @@ foo = {                         # ruby-deep-indent-disabled
   a: b
 }
 
-foo = { a: b
+foo = { a: b,
         a1: b1
       }