I've been using Emacs/ESS for quite a while, and I'm familiar with Hadley's R style recommendations. I'd like to follow these conventions in ESS, like those nice spaces around operators, space after comma and after if statement, before curly braces, etc.

Did anyone even bothered to follow this style guide at all? IMHO, official style recommendations are quite modest, and they say nothing about the style whatsoever. Google R style guide are too similar with the ones I use when I code in JavaScript, so it's a no-no.

Long story short: is there anyone with (e)LISP skills willing to implement (Hadley's) style guide for ESS?

I don't write Elisp, and I disagree with Hadley about the stylistic merits of underscores. Moreover, Hadley is still lost in the desert of not using the OneTrueEditor so we can expect no help from him on this on this issue.

But if you are open to follow R Core rather than Hadley, below is what the R Internals manual, section 8. "R Coding Standards" recommends. To me, it is R Core who defines R style first and foremost. Google's and Hadley's styles are nice secondary recommendations.

Anyway, back to Elisp. The following has served we well for many years, and I do like the fact that the basic R behaviour is similar to the Emacs C++ style as I happen to look at code in both modes a lot.

[...]

It is also important that code is written in a way that allows
others to understand it. This is particularly helpful for fixing
problems, and includes using self-descriptive variable names,
commenting the code, and also formatting it properly. The R Core Team
recommends to use a basic indentation of 4 for R and C (and most
likely also Perl) code, and 2 for documentation in Rd format. Emacs
(21 or later) users can implement this indentation style by putting
the following in one of their startup files, and using customization
to set the c-default-style' to"bsd"' and c-basic-offset' to4'.)

+1 I'm lost in the same desert as Hadley, but I'll give you +1 for linking to XKCD.
–
AndrieSep 21 '11 at 15:55

2

Ahh, it's all just friendly jestering. I love Hadley almost as much as the next guy, but the underscores still keep me awake at night. Not to mention the pastel colours in ggplot. Ouch.
–
Dirk EddelbuettelSep 21 '11 at 15:58

2

That said, I'd be all for someone writing an ESS setup for his style, and/or for Google's. The more the merrier. Until then, I am rather content with what R Core has provided.
–
Dirk EddelbuettelSep 21 '11 at 16:00

2

@Andrie, it may seem overwhelming at first, but you'll get used to this after a while... Dammit, you'll even start adding your own!!! =)
–
aL3xaSep 21 '11 at 16:04

With the development version of ESS (to be released in September 2015), just add to your ess-mode-hook:

(ess-set-style 'RStudio)

RStudio also has a 'Vertically align arguments' checkbox that is set by default. If you want to reproduce the behaviour when this setting is unchecked (as in Hadley's code), you'll need to change ess-offset-arguments to prev-line: