[ESS] Auto-fill mode and Roxygen

Henning Redestig henning.red at googlemail.com
Sat Sep 11 00:54:29 CEST 2010

2010/9/11 Feng Li <feng.li at stat.su.se>:
> I started to use Roxygen to document my R code and everything is perfect.  I
> turned auto-fill-mode on under the ess-mode-hook. When I use the usual
> commenting style "##" the auto fill mode dose exactly what I want -- It
> starts a new line and add "##" in font of this line after the 70th column as
> I am typing. But the auto-fill mode gives me something like this when if I
> am using Roxygen style of commenting.
> ##' I am typing a very long sentence and after 70th column I'd like to start
> ##a new line that begins with double pound signs and an apostrophe but...
> Any suggestions to fix this? BTW, I have ESS 5.11 and Emacs 23.2 installed.

I think auto-fill-mode is convenient for editing normal text but not
so much for source code (can give unwanted behavior) so I would
suggest to turn that off again and then when your line starts to get
long just hit M-q to get "##' " at the start of the wrapped lines. You
can also do C-c C-o to "clean" a the whole roxygen entry to wrap all
lines and update @param fields from the function definition.

/Henning Redestig

Metabolome Informatics Unit | Yokohama RIKEN Plant Science Center

More information about the ESS-help mailing list