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

Vincent Arel-Bundock v|ncent@@re|-bundock @end|ng |rom umontre@|@c@
Wed Jun 2 15:14:21 CEST 2021


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



More information about the ESS-help mailing list