[ESS] outline-minor-mode

Stephen Eglen S.J.Eglen at damtp.cam.ac.uk
Sat Feb 4 09:51:24 CET 2006

 > maybe I missed some ESS functionality, but I considere to use
 > outline-minor-mode in R syntax buffers. I would like to use the comment
 > lines as headings. The problem I don't know to solve is that in R usually
 > comments starting with ### are considered as higher level than comments
 > starting with ## or #.

yes, and that follows the elisp convention for comments.
 > As far as I understood outline-mode would treat them the other way round i.e.
 > # comment would be considered as top level, ## comment as second,
 and so on.

Yes. outline-regexp is a variable that controls what regexp is used to
find headers at the start of a line. So, three hashes would be taken
as a level 3 heading, deeper than one hash (level one).  I just took a
quick look in the elisp, and couldn't see a way to specify the level
separately from the regexp.

Furthermore, if you use ESS's indenting, you'd see that comments with
either one or two hashes won't be found at the start of the line,
which might mess things up.

Possibly the solution would be to use three hashes followed by some
variable number of asterisks to denote your header:

### * Init code

### ** New vars


More information about the ESS-help mailing list