Skip to content

How to comment out multiple lines in R source code?

2 messages · Emmanuel Paradis, Sven Garbade

#
At 07:33 11/10/01 +0100, Prof Brian D Ripley <ripley at stats.ox.ac.uk> wrote:
In (X)Emacs, you can add a character at the beginning of several lines at
once by selecting a block of lines, and then typing C-x r t # (where you
can replace # by any other character or even a string; `C-x' means
`Ctrl-x'). This does not need ESS. You can even add the # in the middle of
the lines if your block selection starts at this point (in case you want to
comment out the right hand-side of a command... maybe not very usual).

BTW, the possibility to (un)comment out a block a R commands does not
appear in the ESS menu (it does in C-mode), and I did not find it in ESS's
doc (but I admit I did not read it all carefully).

Emmanuel Paradis

Emmanuel Paradis
Laboratoire de Pal?ontologie
Institut des Sciences de l'?volution
Universit? Montpellier II
F-34095 Montpellier c?dex 05
France
   phone: +33  4 67 14 39 64
     fax: +33  4 67 14 36 10
  mailto:paradis at isem.univ-montp2.fr
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
Emmanuel Paradis wrote:
You can type M-x comment-region to comment and C-u M-x comment-region to
uncomment a region in (X)Emacs ESS-Mode.

Best, Sven
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._