* lisp/progmodes/ruby-mode.el (ruby-smie-rules): Indent after + used as
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 21 Oct 2013 13:34:13 +0000 (09:34 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 21 Oct 2013 13:34:13 +0000 (09:34 -0400)
an instruction.

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

index e9de6a7..b8cc19b 100644 (file)
@@ -1,3 +1,8 @@
+2013-10-21  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * progmodes/ruby-mode.el (ruby-smie-rules): Indent after + used as
+       an instruction.
+
 2013-10-21  Dmitry Gutov  <dgutov@yandex.ru>
 
        * progmodes/ruby-mode.el (ruby-smie-grammar): Add (almost) all infix operators.
 
        Allow comma separated lists after Java "implements".
 
-       * progmodes/cc-engine.el (c-backward-over-enum-header): parse
-       commas.
+       * progmodes/cc-engine.el (c-backward-over-enum-header):
+       Parse commas.
        * progmodes/cc-fonts.el (c-basic-matchers-after): Remove comma
        from a "disallowed" list in enum fontification.
 
 2013-10-20  Johan Bockgård  <bojohan@gnu.org>
 
-       * startup.el (default-frame-background-mode): Remove unused
-       defvar.
+       * startup.el (default-frame-background-mode): Remove unused defvar.
 
        * progmodes/verilog-mode.el (verilog-mode): Don't set
        comment-indent-function globally.
        * ielm.el (ielm-map): Bind M-RET to ielm-return-for-effect.
        (ielm-return-for-effect): New command.
        (ielm-send-input): Accept optional `for-effect' parameter.
-       (ielm-eval-input): Accept optional `for-effect' parameter.  Bind
-       `standard-output' to stream we create using
+       (ielm-eval-input): Accept optional `for-effect' parameter.
+       Bind `standard-output' to stream we create using
        `ielm-standard-output-impl'.  Suppress printing result when
        `for-effect'.
        (ielm-standard-output-impl): New function.
index fcbe4fd..2800163 100644 (file)
@@ -498,6 +498,8 @@ explicitly declared in magic comment."
     (`(:before . ,(or `"else" `"then" `"elsif" `"rescue" `"ensure")) 0)
     (`(:before . ,(or `"when"))
      (if (not (smie-rule-sibling-p)) 0)) ;; ruby-indent-level
+    (`(:after . "+")       ;FIXME: Probably applicable to most infix operators.
+     (if (smie-rule-parent-p ";") ruby-indent-level))
     ))
 
 (defun ruby-imenu-create-index-in-block (prefix beg end)
index 198ad63..c9ec8bd 100644 (file)
@@ -186,11 +186,11 @@ if foo &&
    bar
 end
 
-# Examples below still fail with `ruby-use-smie' on:
-
 foo +
   bar
 
+# Examples below still fail with `ruby-use-smie' on:
+
 foo = [1, 2, 3].map do |i|
   i + 1
 end