I use Gnu emacs 21, Linux RH9 and R-1.7.0. I have succeeded to get the recommended indentation of 4 in C thru customization as described in 'R-exts', p.73, but I can't get it to work in R code. Can someone help, for instance by sending me the appropriate lines in '.emacs'? Thanks! --- G?ran Brostr?m tel: +46 90 786 5223 Department of Statistics fax: +46 90 786 6614 Ume? University http://www.stat.umu.se/egna/gb/ SE-90187 Ume?, Sweden e-mail: gb at stat.umu.se
R indentation
2 messages · Göran Broström, Brian Ripley
On Sat, 17 May 2003, G?ran Brostr?m wrote:
I use Gnu emacs 21, Linux RH9 and R-1.7.0. I have succeeded to get the recommended indentation of 4 in C thru customization as described in 'R-exts', p.73, but I can't get it to work in R code. Can someone help, for instance by sending me the appropriate lines in '.emacs'?
;;;-- Implement "R core indentation style"--------------------------------
(setq ess-mode-hook
'(lambda()
(ess-set-style 'C++ 'quiet)
(add-hook 'local-write-file-hooks
'(lambda()
(nuke-trailing-whitespace)
))
))
(add-hook 'perl-mode-hook
'(lambda() (setq perl-indent-level 4)))
works for me, *provided* I have set (via customization)
(custom-set-variables
;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
;; Your init file should contain only one such instance.
'(c-basic-offset 4)
'(c-default-style "bsd"))
Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595