diff options
| author | Dmitry Gutov | 2013-10-08 02:01:23 +0300 |
|---|---|---|
| committer | Dmitry Gutov | 2013-10-08 02:01:23 +0300 |
| commit | 0ea1599d34414dbdc77c46208535c2ebdb614885 (patch) | |
| tree | 6e7625116d5ebdca693e9191d709f53ca0408db3 | |
| parent | 595e113b15e2ce80b95d39d1851ce78f25ffa1f4 (diff) | |
| download | emacs-0ea1599d34414dbdc77c46208535c2ebdb614885.tar.gz emacs-0ea1599d34414dbdc77c46208535c2ebdb614885.zip | |
* lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Handle the
case of the dot in a chained method call being on the following
line.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/progmodes/ruby-mode.el | 5 | ||||
| -rw-r--r-- | test/indent/ruby.rb | 4 |
3 files changed, 12 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 520e41afc68..93d09d4b55c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2013-10-07 Dmitry Gutov <dgutov@yandex.ru> | ||
| 2 | |||
| 3 | * progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Handle the | ||
| 4 | case of the dot in a chained method call being on the following | ||
| 5 | line. | ||
| 6 | |||
| 1 | 2013-10-07 Stefan Monnier <monnier@iro.umontreal.ca> | 7 | 2013-10-07 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 8 | ||
| 3 | * electric.el (electric-indent-inhibit): New var. | 9 | * electric.el (electric-indent-inhibit): New var. |
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 6497fb6b7d0..c96eccbfecb 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el | |||
| @@ -295,7 +295,10 @@ Also ignores spaces after parenthesis when 'space." | |||
| 295 | (and (memq (char-before) '(?\? ?=)) | 295 | (and (memq (char-before) '(?\? ?=)) |
| 296 | (let ((tok (ruby-smie--backward-token))) | 296 | (let ((tok (ruby-smie--backward-token))) |
| 297 | (or (equal tok "?") | 297 | (or (equal tok "?") |
| 298 | (string-match "\\`\\s." tok)))))))) | 298 | (string-match "\\`\\s." tok)))) |
| 299 | (save-excursion | ||
| 300 | (forward-comment 1) | ||
| 301 | (eq (char-after) ?.)))))) | ||
| 299 | 302 | ||
| 300 | (defun ruby-smie--redundant-do-p (&optional skip) | 303 | (defun ruby-smie--redundant-do-p (&optional skip) |
| 301 | (save-excursion | 304 | (save-excursion |
diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb index 366d572449f..2b2b95bf47b 100644 --- a/test/indent/ruby.rb +++ b/test/indent/ruby.rb | |||
| @@ -137,8 +137,6 @@ desc "foo foo" \ | |||
| 137 | foo. | 137 | foo. |
| 138 | bar | 138 | bar |
| 139 | 139 | ||
| 140 | # Examples below still fail with `ruby-use-smie' on: | ||
| 141 | |||
| 142 | # https://github.com/rails/rails/blob/17f5d8e062909f1fcae25351834d8e89967b645e/activesupport/lib/active_support/time_with_zone.rb#L206 | 140 | # https://github.com/rails/rails/blob/17f5d8e062909f1fcae25351834d8e89967b645e/activesupport/lib/active_support/time_with_zone.rb#L206 |
| 143 | foo | 141 | foo |
| 144 | .bar | 142 | .bar |
| @@ -150,6 +148,8 @@ z = { | |||
| 150 | } | 148 | } |
| 151 | } | 149 | } |
| 152 | 150 | ||
| 151 | # Examples below still fail with `ruby-use-smie' on: | ||
| 152 | |||
| 153 | foo + | 153 | foo + |
| 154 | bar | 154 | bar |
| 155 | 155 | ||