[ESS] Auto-fill mode and Roxygen

Henning Redestig henning.red at googlemail.com
Wed Sep 22 02:41:04 CEST 2010

2010/9/11 Feng Li <feng.li at stat.su.se>:
> Thanks your reply. I totally agree with your option. But it is good to have
> this feature, since people are lazy, like me. Apparently I put a explicit
> prefix "##' " under the ess-mode-hook to avoid that.
>          (setq adaptive-fill-first-line-regexp
>            "##' "
>            adaptive-fill-regexp
>            "##' ")
> This works well but I am not good at regular expressions. So this workaround
> could not determine the prefix like "##'" plus some indents. Maybe people
> here can help me with this:).

I had a look at this and it seems easier than I originally thought. If
I add the following to R mode hook I get filling inside roxy entries
in an adaptive fashion, seems to be what you are after?

(make-local-variable 'adaptive-fill-regexp)
(setq adaptive-fill-regexp (concat ess-roxy-str adaptive-fill-regexp))
(make-local-variable 'adaptive-fill-first-line-regexp)
(setq adaptive-fill-first-line-regexp (concat ess-roxy-str
(make-local-variable 'paragraph-start)
(setq paragraph-start (concat "\\(" ess-roxy-str "\\)*" paragraph-start))
(make-local-variable 'paragraph-separate)
(setq paragraph-separate (concat "\\(" ess-roxy-str "\\)*" paragraph-separate))

/Henning Redestig

Metabolome Informatics Unit | Yokohama RIKEN Plant Science Center

More information about the ESS-help mailing list