[ESS] Indentation level

Martin Maechler maechler at stat.math.ethz.ch
Mon May 17 11:36:39 CEST 2010


>>>>> "SE" == Stephen Eglen <S.J.Eglen at damtp.cam.ac.uk>
>>>>>     on Mon, 17 May 2010 09:52:02 +0100 writes:

    SE> hi Martin,


    >> 
    >> I would like "us" to change this before releasing ESS 5.9 if
    >> possible.
    >> I have no time for this, this week though.
    >> 


    SE> I looked at this code over the weekend, and have some new code ready to
    SE> check in (but not today, maybe tomorrow/Wed).  So we should be able to
    SE> get it in (and tested) before 5.9 comes out.

Good!  Thanks in advance.

    SE> In the meantime, please can you check whether you need

    >> >> http://stat.ethz.ch/CRAN/doc/manuals/R-ints.html#R-coding-standards
    >> >> (about one page down):
    >> >> 
    >> >> ;;; ESS
    >> >> (add-hook 'ess-mode-hook
    >> >> (lambda ()
    >> >> (ess-set-style 'C++ 'quiet)

    SE> do you need to add that within a hook?  From my reading of the code, you
    SE> should be able to just do:

    SE> (setq ess-default-style 'C++)

    SE> as a top-level expression, rather thatn within a hook, to get your C++
    SE> settings.

Yes, that's correct.  The ess-default-style setting,
even when used via  (custom-set-variables   ... ),
i.e., as customized variable
does work, too.

The reason I use the hook is because I additionally want the 
"nuke-trailing-whitespace" which some people may find extreme.
I basically have

   (add-hook 'ess-mode-hook
             '(lambda()
  	         (ess-set-style 'C++ 'quiet)
		 (add-hook 'local-write-file-hooks
			   '(lambda() (ess-nuke-trailing-whitespace) ))))

Martin



More information about the ESS-help mailing list