Skip to content
Prev 27110 / 63458 Next

re quest for addition to R-int

Martin Maechler <maechler <at> stat.math.ethz.ch> writes:
The current paragraph says:
   
    It is also important that code is written in a way that allows others to
understand it. This
is particularly helpful for fixing problems, and includes using self-descriptive
variable names,
commenting the code, and also formatting it properly. The R Core Team recommends
to use a
basic indentation of 4 for R and C (and most likely also Perl) code, and 2 for
documentation in
Rd format. Emacs users can implement this indentation style by putting the
following in one
of their startup files. (For GNU Emacs 20: for GNU Emacs 21 or later use
customization to set
the c-default-style to "bsd" and c-basic-offset to 4.)

  [followed by emacs code, including the ESS stuff]

  I read the paragraph above and assumed that I could (and
should) use the customization hooks in Emacs 21 rather than
putting the code in my .emacs file by hand.  In fact, I'm
a little confused; the customization recommended appears to
have set the following ...

(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 (quote ((c-mode . "bsd") (java-mode . "java") (other . "gnu")))))

  which takes care of the C mode stuff but doesn't do anything
for ESS or Perl?

 Perhaps change the last sentence to

  (In GNU Emacs 21 or later one can instead use customization to set
the c-default-style to "bsd" and c-basic-offset to 4, although
the ESS and Perl styles still need to be set manually.)

  ?

  Ben