ESS sets tab space level?

I thought you set the indentation level with

(setq ess-indent-level 2) 

But I keep getting 4 spaces. For example, I wrote

 foo <- function(x) x + 2 

But now ESS puts the second line in 4 spaces from the left margin

 foo <- function(x) x + 2 

Has something changed between the new and old versions? I used to use ESS 5.11 and just upgrade to 13.05 (!).

+7
r emacs ess
source share
1 answer

Yes, a lot has changed since 5.11. The default indentation style now follows the R standard 4 spaces for indentation. Select the best style from ess-style-alist and set ess-default-style :

 (setq ess-default-style 'OWN) 

To revert to the old default values ​​and configure the parameters for individual variables, for example ess-indent-level add this:

 (setq ess-default-style 'DEFAULT) 

A bit confusing, the name DEFAULT comes from default-value , i.e. the style is based on the default settings for indentation, such as ess-indent-level , ess-arg-function-offset , ess-brace-offset , etc.

FWIW, you can change the indent syntax interactively using Cc. ( Cc Ce Cs since 2014).

+11
source share

All Articles