Style: avoid new lines in chains of square brackets [][]

Vincent Arel-Bundock via ESS-help <[email protected]>
Newsgroups gmane.emacs.ess.general
Message-ID <[email protected]>
Hi all,

Thanks for your awesome work on ESS!

I use the data.table package with chains of square brackets, and would like to indent my code as follows:

library(data.table)
dat = data.table(mtcars)
dat[
    cyl == 4][
  , gear := gear * 3]

However, when I type this code, new lines get inserted automatically and I get this:

dat[
    cyl == 4
][
    , gear := gear * 3
]

I have read the documentation for all the variables listed under ess-style-alist but have been unable to find an answer to my question. This is certainly my fault, as I am a new emacs and ess user. Nevertheless, I thought I'd ask here in case someone knows how to avoid inserting new lines in chains of square brackets.

Thanks!

--
Vincent Arel-Bundock

Livre en libre accès: Analyse Causale et Méthodes Quantitatives
http://arelbundock.com/acmq.html

Professeur agrégé / Associate professor
Université de Montréal, Science politique
3150 rue Jean-Brillant, Pav. Lionel-Groulx, C-4020
Montréal, Québec, Canada, H3T 1N8
http://arelbundock.com

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.