Skip to content

R indentation

2 messages · Göran Broström, Brian Ripley

#
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
#
On Sat, 17 May 2003, G?ran Brostr?m wrote:

            
;;;-- 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"))