Hi emacs gurus - I wonder if you know how to get hideshow work with new modes. For instance, I have some extraneous code I want to hide with R. With folding-mode it can simply be
(load "folding" 'nomessage 'noerror)
(folding-add-to-marks-list 'ess-mode "# {{{" "# }}}" nil t)
(add-hook 'ess-mode-hook 'turn-on-folding-mode)
I thought the hideshow equivalent would be
(add-to-list 'hs-special-modes-alist
'(ess-mode "# {{{" "# }}}" "#[ #]?"
hs-forward-sexp
hs-c-like-adjust-block-beginning
))
(add-hook 'ess-mode-hook '(lambda()
(hs-minor-mode 1)
(hs-hide-all)
(custom-set-variables
(hs-hide-comments-when-hiding-all 0)
)
))
but I think there is some magic in hs-forward-sexp that I am not sure how to figure out?
I tried adapting a function written for c-sharp (replacing the regex search on region/endregion with {{{ and }}}) but no luck! I wonder if the solution is obvious to a veteran out there...
Thanks much!