From gb at stat.umu.se  Tue Feb 17 23:03:50 2009
From: gb at stat.umu.se (=?ISO-8859-1?Q?G=F6ran_Brostr=F6m?=)
Date: Tue, 17 Feb 2009 23:03:50 +0100
Subject: [Rd] C basic indentation
Message-ID: <499B3446.1080505@stat.umu.se>

I use the recommendations in "R coding standards", i.e., I put

      ;;; C
      (add-hook 'c-mode-hook
                (lambda () (c-set-style "bsd")))
      ;;; ESS
      (add-hook 'ess-mode-hook
                (lambda ()
                  (ess-set-style 'C++ 'quiet)
                  (add-hook 'local-write-file-hooks
                            (lambda ()
                              (ess-nuke-trailing-whitespace)))))
      (setq ess-nuke-trailing-whitespace-p 'ask)
      ;;; Perl
      (add-hook 'perl-mode-hook
                (lambda () (setq perl-indent-level 4)))

into my .emacs file. IIRC, back in 2005 it gave me a basic indentation 
of 4 in C (good), but only 2 in R (not so good, but I fixed it with the 
aid of this excellent list). But now it gives me a basic indentation of 
eight (8!) in C code. This is not what I want. I think I saw somewhere 
that the bsd standard actually has changed from four to eight recently 
(but I cannot find it now).

Two points given that the standard really has changed: (i) The text in 
"R coding standards" should be changed accordingly. (ii) How do I get 
back to a basic indentation of 4 in C and R code?

G?ran

 > sessionInfo()
R version 2.8.1 Patched (2009-01-03 r47458)
i686-pc-linux-gnu

locale:
LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;
LC_MONETARY=C;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;
LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

GNU Emacs 22.2.1 on Ubuntu 8.10 x64
-- 
G?ran Brostr?m               phone: 46 90 786 5223; 46 705 197 507
Department of Statistics     fax: 46 90 786 6614
Ume? University              email: gb at stat.umu.se
SE-90187 Ume?, Sweden        http://tal.stat.umu.se/~gb



[Rd] C basic indentation
=?ISO-8859-1?Q?G=F6ran_Brostr=F6m?=