Skip to content
Back to formatted view

Raw Message

Message-ID: <Pine.LNX.4.44.0305171355030.21068-100000@gannet.stats>
Date: 2003-05-17T12:59:04Z
From: Brian Ripley
Subject: R indentation
In-Reply-To: <Pine.LNX.4.44.0305171242420.10584-100000@tal.stat.umu.se>

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