all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: trunk r114545: * lisp/progmodes/ruby-mode.el: Fix recently added tests.
       [not found] <E1VT1eQ-0007di-60@vcs.savannah.gnu.org>
@ 2013-10-07 11:29 ` Dmitry Gutov
  2013-10-07 15:22   ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Gutov @ 2013-10-07 11:29 UTC (permalink / raw
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:
>  a = foo(j, k) -
> -  bar_tee
> +    bar_tee

Hmm, that indentation looks meaningful, and it's even close to
implementing one of the long-standing feature requests
(http://bugs.ruby-lang.org/issues/5357), but I suspect it'll go against
some established codebases.

I think we'll need a toggle here, eventually.

>  foo.
>    bar
>
> +# FIXME: is this really valid Ruby?  Isn't the newline after "foo" treated as
> +# an implicit semi-colon?
>  foo
>    .bar

It is, I guess it's the main exception to the newline termination rule.

This style is actually preferred over keeping the dot on the first line:

https://github.com/bbatsov/ruby-style-guide (search for "chained method
invocation")



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: trunk r114545: * lisp/progmodes/ruby-mode.el: Fix recently added tests.
  2013-10-07 11:29 ` trunk r114545: * lisp/progmodes/ruby-mode.el: Fix recently added tests Dmitry Gutov
@ 2013-10-07 15:22   ` Stefan Monnier
  2013-10-07 23:27     ` Dmitry Gutov
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2013-10-07 15:22 UTC (permalink / raw
  To: Dmitry Gutov; +Cc: emacs-devel

>> a = foo(j, k) -
>> -  bar_tee
>> +    bar_tee
> Hmm, that indentation looks meaningful, and it's even close to
> implementing one of the long-standing feature requests
> (http://bugs.ruby-lang.org/issues/5357),

Indeed, it's the indentation style I see in most examples.

>> +# FIXME: is this really valid Ruby?  Isn't the newline after "foo" treated as
>> +# an implicit semi-colon?
>> foo
>> .bar
> It is, I guess it's the main exception to the newline termination rule.

Is the newline termination rule documented somewhere?  All I could find
was discussions about the style, but no definitive clear definition of
when a newline is treated as a semi-colon.

Anyway, you can adjust ruby-smie--implicit-semi-p to reflect the "rule".


        Stefan



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: trunk r114545: * lisp/progmodes/ruby-mode.el: Fix recently added tests.
  2013-10-07 15:22   ` Stefan Monnier
@ 2013-10-07 23:27     ` Dmitry Gutov
  0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Gutov @ 2013-10-07 23:27 UTC (permalink / raw
  To: Stefan Monnier; +Cc: emacs-devel

On 07.10.2013 18:22, Stefan Monnier wrote:
>>> +# FIXME: is this really valid Ruby?  Isn't the newline after "foo" treated as
>>> +# an implicit semi-colon?
>>> foo
>>> .bar
>> It is, I guess it's the main exception to the newline termination rule.
>
> Is the newline termination rule documented somewhere?  All I could find
> was discussions about the style, but no definitive clear definition of
> when a newline is treated as a semi-colon.

This is the best I'm aware of: 
http://whitequark.org/blog/2013/04/01/ruby-hacking-guide-ch-11-finite-state-lexer/ 
(search for "Line-break handling").

I don't see the exception mentioned.

> Anyway, you can adjust ruby-smie--implicit-semi-p to reflect the "rule".

Done, seems to work.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-07 23:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <E1VT1eQ-0007di-60@vcs.savannah.gnu.org>
2013-10-07 11:29 ` trunk r114545: * lisp/progmodes/ruby-mode.el: Fix recently added tests Dmitry Gutov
2013-10-07 15:22   ` Stefan Monnier
2013-10-07 23:27     ` Dmitry Gutov

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.