diff options
| author | Stefan Monnier | 2013-10-21 09:34:13 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2013-10-21 09:34:13 -0400 |
| commit | df74c4be16efb83408b78c5b1205fccfb2c10696 (patch) | |
| tree | e440d2a7dac62236a578fdeee4a9a0d6ff138052 | |
| parent | c7e36328c69e8363928390fa8ee909d7a1cfd5b0 (diff) | |
| download | emacs-df74c4be16efb83408b78c5b1205fccfb2c10696.tar.gz emacs-df74c4be16efb83408b78c5b1205fccfb2c10696.zip | |
* lisp/progmodes/ruby-mode.el (ruby-smie-rules): Indent after + used as
an instruction.
| -rw-r--r-- | lisp/ChangeLog | 16 | ||||
| -rw-r--r-- | lisp/progmodes/ruby-mode.el | 2 | ||||
| -rw-r--r-- | test/indent/ruby.rb | 4 |
3 files changed, 14 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e9de6a7669c..b8cc19b383c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-10-21 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * progmodes/ruby-mode.el (ruby-smie-rules): Indent after + used as | ||
| 4 | an instruction. | ||
| 5 | |||
| 1 | 2013-10-21 Dmitry Gutov <dgutov@yandex.ru> | 6 | 2013-10-21 Dmitry Gutov <dgutov@yandex.ru> |
| 2 | 7 | ||
| 3 | * progmodes/ruby-mode.el (ruby-smie-grammar): Add (almost) all infix operators. | 8 | * progmodes/ruby-mode.el (ruby-smie-grammar): Add (almost) all infix operators. |
| @@ -12,15 +17,14 @@ | |||
| 12 | 17 | ||
| 13 | Allow comma separated lists after Java "implements". | 18 | Allow comma separated lists after Java "implements". |
| 14 | 19 | ||
| 15 | * progmodes/cc-engine.el (c-backward-over-enum-header): parse | 20 | * progmodes/cc-engine.el (c-backward-over-enum-header): |
| 16 | commas. | 21 | Parse commas. |
| 17 | * progmodes/cc-fonts.el (c-basic-matchers-after): Remove comma | 22 | * progmodes/cc-fonts.el (c-basic-matchers-after): Remove comma |
| 18 | from a "disallowed" list in enum fontification. | 23 | from a "disallowed" list in enum fontification. |
| 19 | 24 | ||
| 20 | 2013-10-20 Johan Bockgård <bojohan@gnu.org> | 25 | 2013-10-20 Johan Bockgård <bojohan@gnu.org> |
| 21 | 26 | ||
| 22 | * startup.el (default-frame-background-mode): Remove unused | 27 | * startup.el (default-frame-background-mode): Remove unused defvar. |
| 23 | defvar. | ||
| 24 | 28 | ||
| 25 | * progmodes/verilog-mode.el (verilog-mode): Don't set | 29 | * progmodes/verilog-mode.el (verilog-mode): Don't set |
| 26 | comment-indent-function globally. | 30 | comment-indent-function globally. |
| @@ -168,8 +172,8 @@ | |||
| 168 | * ielm.el (ielm-map): Bind M-RET to ielm-return-for-effect. | 172 | * ielm.el (ielm-map): Bind M-RET to ielm-return-for-effect. |
| 169 | (ielm-return-for-effect): New command. | 173 | (ielm-return-for-effect): New command. |
| 170 | (ielm-send-input): Accept optional `for-effect' parameter. | 174 | (ielm-send-input): Accept optional `for-effect' parameter. |
| 171 | (ielm-eval-input): Accept optional `for-effect' parameter. Bind | 175 | (ielm-eval-input): Accept optional `for-effect' parameter. |
| 172 | `standard-output' to stream we create using | 176 | Bind `standard-output' to stream we create using |
| 173 | `ielm-standard-output-impl'. Suppress printing result when | 177 | `ielm-standard-output-impl'. Suppress printing result when |
| 174 | `for-effect'. | 178 | `for-effect'. |
| 175 | (ielm-standard-output-impl): New function. | 179 | (ielm-standard-output-impl): New function. |
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index fcbe4fdb7c4..280016317e7 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el | |||
| @@ -498,6 +498,8 @@ explicitly declared in magic comment." | |||
| 498 | (`(:before . ,(or `"else" `"then" `"elsif" `"rescue" `"ensure")) 0) | 498 | (`(:before . ,(or `"else" `"then" `"elsif" `"rescue" `"ensure")) 0) |
| 499 | (`(:before . ,(or `"when")) | 499 | (`(:before . ,(or `"when")) |
| 500 | (if (not (smie-rule-sibling-p)) 0)) ;; ruby-indent-level | 500 | (if (not (smie-rule-sibling-p)) 0)) ;; ruby-indent-level |
| 501 | (`(:after . "+") ;FIXME: Probably applicable to most infix operators. | ||
| 502 | (if (smie-rule-parent-p ";") ruby-indent-level)) | ||
| 501 | )) | 503 | )) |
| 502 | 504 | ||
| 503 | (defun ruby-imenu-create-index-in-block (prefix beg end) | 505 | (defun ruby-imenu-create-index-in-block (prefix beg end) |
diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb index 198ad6384f0..c9ec8bd3723 100644 --- a/test/indent/ruby.rb +++ b/test/indent/ruby.rb | |||
| @@ -186,11 +186,11 @@ if foo && | |||
| 186 | bar | 186 | bar |
| 187 | end | 187 | end |
| 188 | 188 | ||
| 189 | # Examples below still fail with `ruby-use-smie' on: | ||
| 190 | |||
| 191 | foo + | 189 | foo + |
| 192 | bar | 190 | bar |
| 193 | 191 | ||
| 192 | # Examples below still fail with `ruby-use-smie' on: | ||
| 193 | |||
| 194 | foo = [1, 2, 3].map do |i| | 194 | foo = [1, 2, 3].map do |i| |
| 195 | i + 1 | 195 | i + 1 |
| 196 | end | 196 | end |