[ESS] indentation of ggplot code and ess 13.09-02

Vitalie Spinu spinuvit at gmail.com
Mon May 19 19:59:14 CEST 2014


 >>> Ramon Diaz-Uriarte on Mon, 19 May 2014 17:35:45 +0200 wrote:

 > Dear All,
 > I have weird indentation problems with ggplot code but only
 > with it[1] with the latest ESS from ELPA. For instance

 > ggplot(data = dd, aes(x = x, y = y)) +
 >     ylab("some y") +
 >         xlab(" some x") +
 >             fact_wrap(~z)

This is not weird. It is how it is supposed to be. Continuation lines
are now indented everywhere, no matter what. In previous versions of ESS
indentation of continuation lines wasn't consistent.

If you don't like it, set ess-first-continued-statement-offset and
ess-continued-statement-offset in your custom indentation style.

Something like this:
     
   (add-to-list 'ess-style-alist
                '(my-style
                  (ess-indent-level . 4)
                  (ess-first-continued-statement-offset . 2)
                  (ess-continued-statement-offset . 0)
                  (ess-brace-offset . -4)
                  (ess-expression-offset . 4)
                  (ess-else-offset . 0)
                  (ess-close-brace-offset . 0)
                  (ess-brace-imaginary-offset . 0)
                  (ess-continued-brace-offset . 0)
                  (ess-arg-function-offset . 4)
   	          (ess-arg-function-offset-new-line . '(4))
                ))
   
   (setq ess-default-style 'my-style)
   
As Martin mentioned, there are still some indentation issues. Please
report here if you notice any.

   Vitalie



More information about the ESS-help mailing list