diff options
| author | Dmitry Gutov | 2013-10-06 03:46:28 +0300 |
|---|---|---|
| committer | Dmitry Gutov | 2013-10-06 03:46:28 +0300 |
| commit | 5cd9cda9b61159051825a2c5ae2700bf280e2cf2 (patch) | |
| tree | 1599c8a62f4ade9f210af9857dabc7bdcdc126f2 | |
| parent | da9ea6d9803d6a12f93ed7b2effd85e254b390e8 (diff) | |
| download | emacs-5cd9cda9b61159051825a2c5ae2700bf280e2cf2.tar.gz emacs-5cd9cda9b61159051825a2c5ae2700bf280e2cf2.zip | |
* lisp/progmodes/ruby-mode.el (ruby-smie-rules): Dedent `ensure'
keyword, too.
* test/indent/ruby.rb: Fix a syntax error, add a few failing examples.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/progmodes/ruby-mode.el | 2 | ||||
| -rw-r--r-- | test/ChangeLog | 4 | ||||
| -rw-r--r-- | test/indent/ruby.rb | 23 |
4 files changed, 32 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 24011e3584c..5a496908af7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-10-06 Dmitry Gutov <dgutov@yandex.ru> | ||
| 2 | |||
| 3 | * progmodes/ruby-mode.el (ruby-smie-rules): Dedent `ensure' | ||
| 4 | keyword, too. | ||
| 5 | |||
| 1 | 2013-10-05 Dmitry Gutov <dgutov@yandex.ru> | 6 | 2013-10-05 Dmitry Gutov <dgutov@yandex.ru> |
| 2 | 7 | ||
| 3 | * newcomment.el (comment-use-global-state): Change default value | 8 | * newcomment.el (comment-use-global-state): Change default value |
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 662cef82259..c1f79eb8711 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el | |||
| @@ -381,7 +381,7 @@ Also ignores spaces after parenthesis when 'space." | |||
| 381 | (looking-at comment-start-skip))))) | 381 | (looking-at comment-start-skip))))) |
| 382 | ;; `(column . ,(smie-indent-virtual)) | 382 | ;; `(column . ,(smie-indent-virtual)) |
| 383 | (smie-rule-parent))) | 383 | (smie-rule-parent))) |
| 384 | (`(:before . ,(or `"else" `"then" `"elsif" `"rescue")) 0) | 384 | (`(:before . ,(or `"else" `"then" `"elsif" `"rescue" `"ensure")) 0) |
| 385 | (`(:before . ,(or `"when")) | 385 | (`(:before . ,(or `"when")) |
| 386 | (if (not (smie-rule-sibling-p)) 0)) ;; ruby-indent-level | 386 | (if (not (smie-rule-sibling-p)) 0)) ;; ruby-indent-level |
| 387 | ;; Hack attack: Since newlines are separators, don't try to align args that | 387 | ;; Hack attack: Since newlines are separators, don't try to align args that |
diff --git a/test/ChangeLog b/test/ChangeLog index ac98b1c3040..bc9addb810b 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2013-10-06 Dmitry Gutov <dgutov@yandex.ru> | ||
| 2 | |||
| 3 | * indent/ruby.rb: Fix a syntax error, add a few failing examples. | ||
| 4 | |||
| 1 | 2013-10-05 Stefan Monnier <monnier@iro.umontreal.ca> | 5 | 2013-10-05 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 6 | ||
| 3 | * indent/ruby.rb: Port a few cases from automated/ruby-mode-tests.el. | 7 | * indent/ruby.rb: Port a few cases from automated/ruby-mode-tests.el. |
diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb index 15315bcf653..d52f4a3e6f6 100644 --- a/test/indent/ruby.rb +++ b/test/indent/ruby.rb | |||
| @@ -37,7 +37,7 @@ foo = [1, # ruby-deep-indent | |||
| 37 | 2] | 37 | 2] |
| 38 | 38 | ||
| 39 | foo = { # ruby-deep-indent-disabled | 39 | foo = { # ruby-deep-indent-disabled |
| 40 | a : b | 40 | a: b |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | foo = [ # ruby-deep-indent-disabled | 43 | foo = [ # ruby-deep-indent-disabled |
| @@ -99,6 +99,27 @@ if something == :== | |||
| 99 | do_something | 99 | do_something |
| 100 | end | 100 | end |
| 101 | 101 | ||
| 102 | begin | ||
| 103 | foo | ||
| 104 | ensure | ||
| 105 | bar | ||
| 106 | end | ||
| 107 | |||
| 108 | # Examples below fail with SMIE. | ||
| 109 | |||
| 102 | # Bug#15369 | 110 | # Bug#15369 |
| 103 | MSG = 'Separate every 3 digits in the integer portion of a number' \ | 111 | MSG = 'Separate every 3 digits in the integer portion of a number' \ |
| 104 | 'with underscores(_).' | 112 | 'with underscores(_).' |
| 113 | |||
| 114 | # Next two fail similarly to the one above, so maybe remove 1 or 2 | ||
| 115 | # after they're fixed: | ||
| 116 | |||
| 117 | a = foo(j, k) - | ||
| 118 | bar_tee | ||
| 119 | |||
| 120 | while a < b do # "do" is optional | ||
| 121 | foo | ||
| 122 | end | ||
| 123 | |||
| 124 | desc "foo foo" \ | ||
| 125 | "bar bar" | ||