What is the proper way to install, configure and activate folding of R script files?

I followed emacswiki.org/emacs/FoldingMode but it doesn't seems to work. I installed folding.el to .emacs/lisp/. I tried to define folding as { and } as you would expect in R. I work a lot with R6 classes, so folding body of methods is quite essential for navigation in class definition.
My current config for folding:

; folding
(add-to-list 'load-path' "~/.emacs.d/lisp/")
(load "folding" 'nomessage 'noerror)
(folding-add-to-marks-list 'r-mode "{" "}" nil t)

Ideally I would like to replicate RStudio folding in Emacs ESS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.