[ESS] R code folding with hideshow-org.el

Vitalie S. vitosmail at rambler.ru
Fri Apr 3 12:31:42 CEST 2009


There is 'hs-toggle-hiding function in hs that does almost the same thing. I am not sure that messing with tab indentation is such a good idea.

It would be extremely useful to have Org like tab-cycling for allout (a good outliner for code: http://www.emacswiki.org/emacs/AllOut),which would work just on headings. 

Does anyone know a way to do that? 

On Thu, 02 Apr 2009 02:40:44 +0200, Short, Tom <TShort at epri.com> wrote:

> To make this work with R/ESS, I added this to my .emacs:
>
> (require 'hideshow)
> (require 'hideshow-org)
> (add-to-list 'hs-special-modes-alist
>              '(ess-mode "{" "}" "/[*/]" nil
> hs-c-like-adjust-block-beginning))
> (global-set-key "\C-ch" 'hs-org/minor-mode) ;; toggles hideshow-org
> (add-hook 'ess-mode-hook 'hs-org/minor-mode) ;; starts for ESS files

Hideshowvis (http://www.emacswiki.org/emacs/hideshowvis.el) is a nifty extension to hideshow which adds -+ and colored rectangle to folded regions. 
I have this in my .emacs:

(autoload 'hideshowvis-enable "hideshowvis" "Highlight foldable regions")
(dolist (hook (list 'emacs-lisp-mode-hook
                    'ess-mode-hook))
  (add-hook hook 'hideshowvis-enable))
(setq hs-special-modes-alist
      (cons '(ess-mode "{" "}" "#" nil nil) hs-special-modes-alist))

VS

> ______________________________________________
> ESS-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help




More information about the ESS-help mailing list