4

In ESS mode with hs-minor-mode on, I want to collapse only those comments which directly belong to a function, not other comments which are separated by newlines. Take this example:

##############
## Section foo
##############

#' This does foobar
#' Returns nothing.
foobar <- function(x) message("hello")

What I would like the comments to fold into is:

##############
## Section foo
##############

#' This does foobar...
foobar <- function(x) message("hello")

And what I get so far is just:

##############...
foobar <- function(x) message("hello")

Now, is there a way to fold just some "connected" comment sections and keep others unfolded?

1 Answer 1

0

Check this variable out hs-hide-comments-when-hiding-all

hs-hide-comments-when-hiding-all is a variable defined in ‘hideshow.el’. Its value is t

Documentation: Hide the comments too when you do an ‘hs-hide-all’.

You can customize this variable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.