From: Dmitry Gutov Date: Mon, 7 Oct 2013 23:01:23 +0000 (+0300) Subject: * lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Handle the X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1345 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0ea1599d34414dbdc77c46208535c2ebdb614885;p=emacs.git * 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. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 520e41afc68..93d09d4b55c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2013-10-07 Dmitry Gutov + + * 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. + 2013-10-07 Stefan Monnier * 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." (and (memq (char-before) '(?\? ?=)) (let ((tok (ruby-smie--backward-token))) (or (equal tok "?") - (string-match "\\`\\s." tok)))))))) + (string-match "\\`\\s." tok)))) + (save-excursion + (forward-comment 1) + (eq (char-after) ?.)))))) (defun ruby-smie--redundant-do-p (&optional skip) (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" \ foo. bar -# Examples below still fail with `ruby-use-smie' on: - # https://github.com/rails/rails/blob/17f5d8e062909f1fcae25351834d8e89967b645e/activesupport/lib/active_support/time_with_zone.rb#L206 foo .bar @@ -150,6 +148,8 @@ z = { } } +# Examples below still fail with `ruby-use-smie' on: + foo + bar